feat: Update jobs to v1beta2 API (#163) #518
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: Python package CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| env: | |
| UV_VERSION: "0.6.6" | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| python-version: ['3.12'] | |
| action: ['lint', 'type', 'format'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - name: Set up uv & venv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: ${{ env.UV_VERSION }} | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| cache-dependency-glob: uv.lock | |
| - name: Typecheck with mypy | |
| run: | | |
| uv run mypy qnexus/ tests/ integration/ | |
| if: ${{ matrix.action == 'type' }} | |
| - name: Check formatting with ruff | |
| run: uv run ruff format --check | |
| if: ${{ matrix.action == 'format' }} | |
| - name: Lint with ruff | |
| run: uv run ruff check | |
| if: ${{ matrix.action == 'lint' }} | |
| test: | |
| name: Test | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', '3.11'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - name: Set up uv & venv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: ${{ env.UV_VERSION }} | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| cache-dependency-glob: uv.lock | |
| - name: Test with pytest | |
| run: | | |
| uv run pytest tests/ --doctest-modules --cov=qnexus --cov-report=html --cov-report=term | |
| - name: Upload pytest test results | |
| uses: actions/upload-artifact@master | |
| with: | |
| name: pytest-results-${{ matrix.python-version }} | |
| path: htmlcov/ | |