Run Tests by cclauss #232
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: Python Tests | |
run-name: Run Tests by ${{ github.actor }} | |
on: | |
push: | |
pull_request: | |
release: | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
tests: | |
env: | |
FORCE_COLOR: 1 | |
strategy: | |
matrix: | |
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
allow-prereleases: true | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- 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 }} | |
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@v5 | |
with: | |
python-version: "3.11" | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install prereq | |
run: pip install tox | |
- name: Run python tests | |
run: tox -e ${{ matrix.toxenv }} | |
pypi-publish: | |
needs: | |
- tests | |
- docs | |
- coveralls | |
if: ${{ success() }} && github.repository == 'oauthlib/oauthlib' && startsWith(github.ref, 'refs/tags') | |
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: Check out repository code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install prereq | |
run: pip install build twine | |
- name: Build python package | |
run: python -m build | |
- name: Check python package | |
run: twine check dist/* | |
- name: Publish package distributions to PyPI | |
if: github.event_name == 'release' && github.event.action == 'published' | |
uses: pypa/gh-action-pypi-publish@release/v1 |