Run Tests by auvipy #267
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: Python Tests | |
| run-name: Run Tests by ${{ github.actor }} | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| tests: | |
| env: | |
| FORCE_COLOR: 1 | |
| strategy: | |
| matrix: | |
| python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Set up Python ${{ matrix.python }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| allow-prereleases: true | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install prereq | |
| run: pip install tox coveralls | |
| - name: Run python tests | |
| run: tox -e ${{ matrix.python }} | |
| - name: Coveralls | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
| COVERALLS_PARALLEL: true | |
| run: coveralls | |
| coveralls: | |
| name: Indicate completion to coveralls.io | |
| needs: tests | |
| runs-on: ubuntu-latest | |
| container: python:3-slim | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Finished | |
| run: | | |
| pip3 install --upgrade coveralls | |
| coveralls --service=github --finish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| docs: | |
| strategy: | |
| matrix: | |
| toxenv: ["docs", "readme"] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - run: sudo apt install -y graphviz | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install prereq | |
| run: pip install tox | |
| - name: Run python tests | |
| run: tox -e ${{ matrix.toxenv }} | |
| build: | |
| name: Build oauthlib distribution | |
| needs: | |
| - tests | |
| - docs | |
| - coveralls | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Check out repository code | |
| uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: Install pypa/build | |
| run: >- | |
| python3 -m | |
| pip install | |
| build | |
| --user | |
| - name: Build wheel and tarball | |
| run: python3 -m build | |
| - name: Store the package's artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| pypi-publish: | |
| if: success() && github.repository == 'oauthlib/oauthlib' && github.ref_type == 'tag' | |
| needs: | |
| - build | |
| name: Upload release to PyPI | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/oauthlib | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| steps: | |
| - name: Download all the dists | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |