Files
ENI-DevSecOps/.github/workflows/ci.yml
2026-02-02 16:04:57 +01:00

63 lines
1.3 KiB
YAML

name: CI
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
jobs:
pre-commit:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install tooling
run: |
python -m pip install --upgrade pip
pip install pre-commit
pip install -r backend/requirements.txt || true
pip install pytest
- name: Run pre-commit hooks
run: pre-commit run --all-files
test:
name: Run tests
needs: pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r backend/requirements.txt || true
pip install pytest
- name: Run tests
run: |
if [ -d backend/tests ]; then
pytest -q
else
echo "No tests directory found: skipping pytest"
fi