Add Python example with linting #17
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: Python Tox | |
on: | |
push: | |
branches: | |
# Run on our main branch | |
- main | |
pull_request: # Run for any pull requests | |
jobs: | |
tox: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Run on Python versions that are stable and not EOL | |
python-version: ["3.10", "3.11", "3.12", "3.13"] | |
tox-job: ["test", "build", "lint", "type"] | |
steps: | |
- uses: actions/checkout@v4 # Checkout the current branch/merge state | |
- name: Set up Python ${{ matrix.python-version }} # Get Python ready to use | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies # Get Tox and Poetry ready | |
working-directory: ./example-python | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox tox-gh-actions | |
curl -sSL https://install.python-poetry.org | python - | |
tox depends --recreate | |
# Run Tox jobs | |
- name: Tox (${{ matrix.tox-job }}) | |
working-directory: ./example-python | |
run: tox -e ${{ matrix.tox-job }} |