release: 1.2.0 --invert --color scheme flag #33
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 Testing | |
on: | |
push: | |
branches: | |
- dev | |
- main | |
pull_request: | |
branches: | |
- main | |
# using parts of approach from https://jacobian.org/til/github-actions-poetry/ | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow | |
# from installing Poetry every time, which can be slow. | |
- name: cache poetry install | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local | |
key: ${{ runner.os }}-poetry | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Cache Poetry packages | |
id: cache-deps | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pypoetry | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root | |
if: steps.cache-deps.outputs.cache-hit != 'true' | |
# Now install _your_ project. This isn't necessary for many types of projects -- particularly | |
# things like Django apps don't need this. But it's a good idea since it fully-exercises the | |
# pyproject.toml and makes that if you add things like console-scripts at some point that | |
# they'll be installed and working. | |
- name: Install marcgrep | |
run: poetry install --no-interaction | |
- name: Run tests | |
run: poetry run pytest |