tests #437
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
| # Generated with zope.meta (https://zopemeta.readthedocs.io/) from: | |
| # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python | |
| name: tests | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: '0 12 * * 0' # run once a week on Sunday | |
| # Allow to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| strategy: | |
| # We want to see all failures: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ["ubuntu", "ubuntu-latest"] | |
| - ["windows", "windows-latest"] | |
| config: | |
| # [Python version, tox env] | |
| - ["3.11", "release-check"] | |
| - ["3.10", "py310"] | |
| - ["3.11", "py311"] | |
| - ["3.12", "py312"] | |
| - ["3.13", "py313"] | |
| - ["3.14", "py314"] | |
| - ["3.15", "py315"] | |
| - ["pypy-3.11", "pypy3"] | |
| - ["3.11", "docs"] | |
| - ["3.11", "coverage"] | |
| exclude: | |
| - { os: ["windows", "windows-latest"], config: ["3.11", "release-check"] } | |
| - { os: ["windows", "windows-latest"], config: ["3.11", "docs"] } | |
| - { os: ["windows", "windows-latest"], config: ["3.11", "coverage"] } | |
| runs-on: ${{ matrix.os[1] }} | |
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
| name: ${{ matrix.os[0] }}-${{ matrix.config[1] }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv + caching | |
| # astral/setup-uv@8.2.0 | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: | | |
| setup.* | |
| tox.ini | |
| python-version: ${{ matrix.config[0] }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Test | |
| run: uvx --with tox-uv tox -e ${{ matrix.config[1] }} | |
| - name: Coverage | |
| if: matrix.config[1] == 'coverage' | |
| run: | | |
| uvx coveralls --service=github | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build package artifacts | |
| if: > | |
| matrix.os[0] == 'ubuntu' | |
| && matrix.config[1] == 'py314' | |
| run: | | |
| rm -f dist/* | |
| pip install -U packaging "setuptools >= 78.1.1,< 82" wheel twine | |
| python setup.py sdist | |
| python setup.py bdist_wheel | |
| - name: Upload package wheel | |
| if: > | |
| matrix.os[0] == 'ubuntu' | |
| && matrix.config[1] == 'py314' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: zope.testing.whl | |
| path: dist/*whl | |
| - name: Upload package source distribution | |
| if: > | |
| matrix.os[0] == 'ubuntu' | |
| && matrix.config[1] == 'py314' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: zope.testing.tar.gz | |
| path: dist/*gz | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| # Only publish on tag pushes | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| # Wait for build jobs to complete | |
| needs: [build] | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/zope.testing | |
| permissions: | |
| contents: read | |
| id-token: write # Mandatory for trusted publishing | |
| steps: | |
| - name: Download package artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: dist/ | |
| pattern: '*' | |
| merge-multiple: true | |
| - name: Display structure of downloaded files | |
| run: | | |
| ls -lR dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| packages-dir: dist/ | |
| verbose: true |