Modify lint job caching #126
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: "Test" | |
on: push | |
# Our test suite should cover: | |
# - Compatibility with the most recent versions of Python and Django | |
# - At least one test run for older supported version of Python and Django | |
# Current configuration: | |
# - python 3.12, django 5.0 | |
# - python 3.12, django 4.2 | |
# - python 3.11, django 4.1 | |
# - python 3.10, django 4.0 | |
# - python 3.9, django 3.2 | |
jobs: | |
lint: | |
name: 🧹 Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.12 | |
cache: "pip" | |
cache-dependency-path: "pyproject.toml" | |
- run: pip install -e .[lint] | |
- name: Run ruff | |
run: ruff check . | |
test: | |
name: 🧪 Test | |
needs: lint | |
runs-on: ubuntu-latest | |
continue-on-error: ${{ matrix.experimental }} | |
env: | |
DJANGO_SETTINGS_MODULE: querystring_tag.testapp.settings | |
strategy: | |
matrix: | |
include: | |
- name: dj5-py312 | |
django: 'Django>=5,<5.1' | |
python: '3.12' | |
latest: true | |
experimental: false | |
- name: dj42-py312 | |
django: 'Django>=4.2,<5' | |
python: '3.12' | |
experimental: false | |
- name: dj41-py311 | |
django: 'Django>=4.1,<4.2' | |
python: '3.11' | |
experimental: false | |
- name: dj32-py39 | |
django: 'Django>=3.2,<4.0' | |
python: '3.9' | |
experimental: false | |
- name: djmain-py312 | |
django: 'git+https://github.com/django/django.git@main#egg=Django' | |
python: '3.12' | |
experimental: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.cfg') }}-${{ matrix.name }} | |
restore-keys: ${{ runner.os }}-pip- | |
- run: | | |
pip install -e .[test] | |
pip install "${{ matrix.django }}" | |
- if: ${{ !matrix.latest }} | |
run: pytest | |
- if: ${{ matrix.latest }} | |
run: pytest --junitxml=junit/test-results.xml --cov=querystring_tag | |
- if: ${{ matrix.latest }} | |
uses: codecov/codecov-action@v3 | |
with: | |
name: Python 3.10 |