CI #861
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: | |
| workflow_dispatch: | |
| schedule: | |
| # Daily at 12:00 UTC | |
| - cron: "0 12 * * *" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| FORCE_COLOR: 1 | |
| permissions: {} | |
| jobs: | |
| build-package: | |
| name: Build & verify package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # for checkout | |
| outputs: | |
| supported-python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: hynek/build-and-inspect-python-package@d44ca7d91762de7a7d5436ddae667c6da6d1c3df # v2.18 | |
| id: baipp | |
| actionlint: | |
| name: Static analysis of GitHub Actions | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # for checkout | |
| checks: write # for reviewdog annotations | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: reviewdog/action-actionlint@6fb7acc99f4a1008869fa8a0f09cfca740837d9d # v1.72.0 | |
| lint: | |
| name: Static analysis of code | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # for checkout | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Install tox | |
| run: uv tool install --with tox-uv tox | |
| - name: Type checks | |
| run: tox -e typing | |
| - name: Lint code | |
| run: tox -e lint | |
| test: | |
| name: Python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| needs: build-package | |
| permissions: | |
| contents: read # for checkout | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04] | |
| python-version: ${{ fromJson(needs.build-package.outputs.supported-python-versions) }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Run tests | |
| env: | |
| PYTHON: ${{ matrix.python-version }} | |
| run: uvx --with tox-uv tox -e "$PYTHON" | |
| - name: Upload coverage data | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| include-hidden-files: true | |
| name: coverage-data-${{ matrix.os }}-py${{ matrix.python-version }} | |
| path: ".coverage.*" | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| needs: test | |
| permissions: | |
| contents: read # for checkout | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| pattern: coverage-data-* | |
| merge-multiple: true | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Combine coverage data and generate report | |
| run: uvx --with tox-uv tox -e coverage |