migrate old tests to pytest-apiver #26
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: Continuous Integration | |
on: | |
push: | |
branches: [master, main] | |
pull_request: | |
branches: [master, main] | |
env: | |
PYTHON_DEFAULT_VERSION: "3.12" | |
jobs: | |
linter: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
cache: "pip" | |
cache-dependency-path: 'pdm.lock' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pdm | |
key: ${{ env.PYTHON_DEFAULT_VERSION }}-pdm-${{ hashFiles('pdm.lock') }} | |
restore-keys: ${{ env.PYTHON_DEFAULT_VERSION }}-pdm- | |
- name: Install dependencies | |
run: python -m pip install --upgrade nox 'pdm>=2.12,<3' | |
- name: Run linters | |
run: nox -vs lint | |
test: | |
timeout-minutes: 10 | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.9", "3.11", "3.12"] | |
django-version: ["3.2", "4.2"] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: 'pdm.lock' | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pdm | |
key: ${{ matrix.python-version }}-pdm-${{ hashFiles('pdm.lock') }} | |
restore-keys: ${{ matrix.python-version }}-pdm- | |
- name: Install dependencies | |
run: python -m pip install --upgrade 'nox==2024.3.2' 'pdm==2.13.2' | |
- name: Run unit tests | |
run: nox -vs test |