CI #816
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: CI | |
| on: | |
| push: | |
| branches: [main, "feature/**"] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 8 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| quality: | |
| name: Quality (ruff + mypy) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install -e ".[dev]" | |
| - run: ruff format --check . | |
| - run: ruff check . | |
| - name: mypy (core modules only) | |
| run: mypy src/omega_pbpk/core src/omega_pbpk/drugs src/omega_pbpk/config.py | |
| continue-on-error: true | |
| test: | |
| name: Test (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| needs: quality | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip install pandas && pip install -e ".[dev,api,auth,viz]" | |
| - name: Check test count | |
| run: | | |
| pytest tests/ --collect-only -q 2>&1 | tail -3 | |
| - name: Run tests with coverage | |
| run: | | |
| pytest tests/ -m "not slow and not benchmark" \ | |
| --cov=src/omega_pbpk \ | |
| --cov-report=term-missing \ | |
| --cov-fail-under=70 \ | |
| -q | |
| - name: Upload coverage | |
| if: matrix.python-version == '3.11' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: .coverage | |
| smoke: | |
| name: Smoke Test | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install pandas && pip install -e ".[dev,api,viz]" | |
| - name: CLI smoke | |
| run: omega --help | |
| - name: Import smoke | |
| run: python -c "import omega_pbpk; print('OK')" | |
| slow-tests: | |
| name: Slow Tests (nightly) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - run: pip install pandas && pip install -e ".[all]" | |
| - name: Run slow tests | |
| run: PYTHONPATH=src python3 -m pytest tests/ -m "slow" --timeout=600 -v |