CI #1099
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-ignore: | |
| - "wip*" | |
| tags: | |
| - "v*" | |
| pull_request: | |
| schedule: | |
| # Daily at 8:33 | |
| - cron: "33 8 * * *" | |
| workflow_dispatch: | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| list: | |
| name: List nox sessions | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # checkout | |
| outputs: | |
| noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }} | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v7.1.0 | |
| with: | |
| enable-cache: false | |
| - id: noxenvs-matrix | |
| run: | | |
| echo >>$GITHUB_OUTPUT noxenvs=$( | |
| uvx nox --list-sessions --json | jq '[.[].session]' | |
| ) | |
| ci: | |
| name: Run nox session | |
| needs: list | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # checkout | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }} | |
| posargs: [""] | |
| include: | |
| - noxenv: tests-3.14 | |
| posargs: coverage github | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.0 | |
| with: | |
| submodules: "recursive" | |
| persist-credentials: false | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v7.1.0 | |
| with: | |
| enable-cache: false | |
| - name: Run nox | |
| env: | |
| NOXENV: ${{ matrix.noxenv }} | |
| POSARGS: ${{ matrix.posargs }} | |
| run: uvx nox -s "$NOXENV" -- $POSARGS | |
| packaging: | |
| name: Package and release | |
| needs: ci | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: PyPI | |
| url: https://pypi.org/p/schemastore | |
| permissions: | |
| contents: write # gh release create | |
| id-token: write # OIDC for trusted publishing to PyPI | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.0 | |
| with: | |
| submodules: "recursive" | |
| persist-credentials: false | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v7.1.0 | |
| with: | |
| enable-cache: false | |
| - name: Build our distributions | |
| run: uv run --frozen --with 'build[uv]' -m build --installer=uv | |
| - name: Publish to PyPI | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1 | |
| - name: Create a Release | |
| if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| REF_NAME: ${{ github.ref_name }} | |
| run: gh release create "$REF_NAME" dist/* --generate-notes |