Generate and add an SBOM to wheels (PEP 770) #320
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: tzdata contents | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.14" | |
| - name: Install tox | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade tox | |
| - name: Build wheel and sdist | |
| run: tox -e build | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: dist | |
| path: dist/ | |
| tests: | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["2.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] | |
| os: ["ubuntu-latest", "windows-latest", "macos-latest"] | |
| exclude: | |
| - python-version: "2.7" | |
| include: | |
| - python-version: "2.7" | |
| os: "ubuntu-latest" | |
| use-container: true | |
| env: | |
| TOXENV: py | |
| container: | |
| image: ${{ matrix.use-container && format('python:{0}', matrix.python-version) || '' }} # zizmor: ignore[unpinned-images] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - if: ${{ !matrix.use-container }} | |
| name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} (non-containers) | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade tox | |
| - name: Run tests | |
| shell: bash | |
| run: | | |
| tox --installpkg dist/tzdata-*.whl | |
| other: | |
| runs-on: "ubuntu-latest" | |
| strategy: | |
| matrix: | |
| toxenv: ["precommit", "typing", "docs"] | |
| env: | |
| TOXENV: ${{ matrix.toxenv }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: ${{ matrix.toxenv }} | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.x" | |
| - name: Install tox | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade tox | |
| - name: Run action | |
| run: | | |
| if [[ $TOXENV == "docs" ]]; then | |
| tox -- -j auto -bhtml -W -n -a --keep-going | |
| else | |
| tox | |
| fi |