fix: robust CI workflow with proper error handling
Some checks failed
CI / test (push) Failing after 6s
CI / lint (push) Failing after 5s

This commit is contained in:
2026-02-01 20:57:44 +00:00
parent 66d0e815ee
commit f23544c243

View File

@@ -2,37 +2,35 @@ name: CI
on: on:
push: push:
branches: [main, master] branches: [main]
pull_request: pull_request:
branches: [main, master] branches: [main]
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: '3.11' python-version: '3.11'
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -e ".[dev]" pip install -e . pytest pytest-cov
- name: Run tests - name: Run tests
run: | run: pytest tests/ -v --tb=short || exit 1
python -m pytest tests/ -v --tb=short
EXIT_CODE=$?
if [ $EXIT_CODE -ne 0 ]; then
echo "Tests failed with exit code $EXIT_CODE"
exit $EXIT_CODE
fi
- name: Run linting lint:
run: | runs-on: ubuntu-latest
pip install ruff steps:
ruff check src/confgen/ tests/ --fix || true - uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install ruff
run: pip install ruff
- name: Run ruff
run: ruff check src/confgen/ || exit 1