Merge pull request #114 from amito/feature/model-catalog-benchmarks-1 #8
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] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: uv sync --extra dev | |
| - name: Ruff check | |
| run: uv run ruff check src/ tests/ | |
| - name: Ruff format check | |
| run: uv run ruff format --check src/ tests/ | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: uv sync --extra dev | |
| - name: Mypy type check | |
| run: uv run mypy src/ | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: uv sync --extra dev | |
| - name: Run unit tests | |
| run: > | |
| uv run pytest tests/ -v --tb=short | |
| -m "not database and not integration" | |
| --cov=src/neuralnav | |
| --cov-report=xml | |
| --cov-report=term | |
| ci-status: | |
| if: always() | |
| needs: [lint, typecheck, test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check CI status | |
| run: | | |
| if [[ "${{ needs.lint.result }}" != "success" || | |
| "${{ needs.typecheck.result }}" != "success" || | |
| "${{ needs.test.result }}" != "success" ]]; then | |
| echo "CI failed" | |
| exit 1 | |
| fi | |
| echo "CI passed" |