Fix doc #407
Workflow file for this run
This file contains 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: build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize] | |
branches: | |
- master | |
workflow_dispatch: {} | |
jobs: | |
publish: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
needs: [test, lint] | |
if: github.event_name == 'workflow_dispatch' | |
env: | |
python_version_publish: "3.13" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-python${{ env.python_version_publish }}-pipcache | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.python_version_publish }} | |
- name: Install denendencies | |
run: | | |
pip install .[publish] && twine --version | |
- name: Publish to testpypi | |
run: make publish publish_repository=testpypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }} | |
- name: Publish to pypi | |
if: github.ref_type == 'tag' | |
run: make publish publish_repository=pypi | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
test: | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
# Available versions: | |
# https://github.com/actions/python-versions/blob/main/versions-manifest.json | |
python-version: ["3.10", "3.11", "3.12", "3.13", "pypy-3.7"] | |
runs-on: [ubuntu-latest] | |
include: | |
- python-version: "3.9" | |
runs-on: ubuntu-20.04 | |
- python-version: "3.8" | |
runs-on: ubuntu-20.04 | |
- python-version: "3.7" | |
runs-on: ubuntu-20.04 | |
- python-version: "3.6" | |
runs-on: ubuntu-20.04 | |
env: | |
python_version_codecov: "3.13" | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache packages | |
# https://github.com/actions/cache/issues/152 | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-python${{ matrix.python-version }}-pipcache | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install denendencies | |
run: | | |
pip install .[test] | |
- name: Run test | |
run: | | |
make test | |
- name: Run codecov | |
uses: codecov/codecov-action@v4 | |
if: matrix.python-version == env.python_version_codecov | |
lint: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
env: | |
python_version_lint: "3.13" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cache packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-python${{ env.python_version_lint }}-pipcache | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.python_version_lint }} | |
- name: Install denendencies | |
run: | | |
pip install .[lint] | |
- name: Run linter | |
run: make lint |