Use uv in CI #2026
Workflow file for this run
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: "Test" | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - "main" | |
| jobs: | |
| tox: | |
| name: "Test ${{ matrix.toxenv }}" | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| toxenv: | |
| - "3.14t" | |
| - "3.14" | |
| - "3.13" | |
| - "3.12" | |
| - "3.11" | |
| - "3.10" | |
| steps: | |
| - name: "Check out repository" | |
| uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8" # v5.0.0 | |
| - name: "Install uv" | |
| uses: "astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41" # v7.1.2 | |
| - name: "Install OS packages" | |
| run: | | |
| sudo apt-get --quiet update | |
| sudo apt-get install --quiet --yes build-essential libxml2-dev libxslt1-dev | |
| - name: "Start integration services" | |
| run: | | |
| docker compose up --detach --wait --wait-timeout 180 --no-deps aipscan-mysql | |
| - name: "Run tox" | |
| env: | |
| TOXENV: ${{ matrix.python }} | |
| run: | | |
| uv run tox -- --cov AIPscan --cov-config .coveragerc --cov-report xml:coverage.xml | |
| - name: "Upload coverage report" | |
| if: ${{ github.repository == 'artefactual-labs/AIPscan' && !contains(github.event.head_commit.message, '[skip codecov]') && !contains(github.event.head_commit.message, '[skip-codecov]') }} | |
| uses: "codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7" # v5.5.1 | |
| env: | |
| CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: true | |
| verbose: true | |
| name: ${{ matrix.toxenv }} | |
| flags: ${{ matrix.toxenv }} | |
| - name: "Stop integration services" | |
| if: ${{ always() }} | |
| run: | | |
| docker compose down --volumes | |
| lint: | |
| name: "Lint" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: "Check out repository" | |
| uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8" # v5.0.0 | |
| - name: "Install uv" | |
| uses: "astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41" # v7.1.2 | |
| - name: "Run linters" | |
| run: make lint | |
| migration-check: | |
| name: "Migration drift" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: "Check out repository" | |
| uses: "actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8" # v5.0.0 | |
| - name: "Start MySQL" | |
| run: docker compose up --detach --wait --wait-timeout 180 --no-deps aipscan-mysql | |
| - name: "Upgrade and check migrations" | |
| run: docker compose run --rm --no-deps aipscan-migrate bash -c "flask db upgrade && flask db check" | |
| - name: "Tear down services" | |
| if: ${{ always() }} | |
| run: docker compose down --volumes |