ci: simplify to Python 3.12 only, drop formatter checks #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [main, master, develop] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| test: | |
| name: Python 3.12 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install uv | |
| run: pip install uv | |
| - name: Install dependencies | |
| run: uv pip install --system -r requirements.txt | |
| - name: Download spaCy model | |
| run: python -m spacy download en_core_web_sm | |
| - name: Run tests | |
| run: pytest test_safety_pipeline.py -v --tb=short | |
| - name: Generate coverage report | |
| run: | | |
| uv pip install --system pytest-cov | |
| pytest test_safety_pipeline.py --cov=llm_safety_pipeline --cov=api_server \ | |
| --cov-report=xml --tb=short -q | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: coverage.xml | |
| fail_ci_if_error: false | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install flake8 | |
| run: pip install flake8 | |
| - name: Lint (flake8) | |
| run: | | |
| flake8 llm_safety_pipeline.py api_server.py \ | |
| --max-line-length=99 \ | |
| --extend-ignore=E203,W503 |