CI #209
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 | |
| tags: | |
| - "*" | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: '0 0 * * 1' | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| FORCE_COLOR: true | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: Build & verify package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - uses: hynek/build-and-inspect-python-package@fe0a0fb1925ca263d076ca4f2c13e93a6e92a33e # v2 | |
| with: | |
| attest-build-provenance-github: ${{ github.event_name != 'pull_request' }} | |
| tox: | |
| name: Tests on ${{ matrix.os }} | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | |
| steps: | |
| - name: Download packages | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 | |
| with: | |
| name: Packages | |
| path: dist/ | |
| - run: tar xf dist/*.tar.gz --strip-components=1 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v7 # zizmor: ignore[cache-poisoning] | |
| - name: Install tox | |
| run: | | |
| uv tool install -p 3.13 --with=tox-uv tox | |
| - name: Show tox config | |
| run: tox c | |
| - name: Setup test suite | |
| run: tox run -vv --notest --skip-missing-interpreters false | |
| - name: Run test suite | |
| run: tox -v --skip-pkg-install --exit-and-dump-after 60 --parallel-no-spinner | |
| - uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v5 | |
| if: ${{ always() }} | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: "Package deployment" | |
| needs: [tox] | |
| permissions: | |
| attestations: write | |
| id-token: write | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download packages | |
| uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 | |
| with: | |
| name: Packages | |
| path: dist/ | |
| - uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 |