Skip to content

Tests

Tests #277

Workflow file for this run

# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
name: "Tests"
on:
push:
pull_request:
workflow_dispatch:
schedule:
# Since we test against the tip of Django development, run the tests once a
# week, Sundays at 6:00 UTC.
- cron: "0 6 * * 0"
permissions:
contents: read
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
FORCE_COLOR: 1 # Get colored pytest output
jobs:
tests:
name: "${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
matrix:
os:
- ubuntu
- macos
- windows
python-version:
# When changing this list, be sure to check the [gh-actions] list in
# tox.ini so that tox will run properly.
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
fail-fast: false
steps:
- name: "Check out the repo"
uses: "actions/checkout@v3"
- name: "Set up Python"
uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
allow-prereleases: true
- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install -r requirements.txt
python -m pip install tox-gh-actions
- name: "Run tox for ${{ matrix.python-version }}"
run: |
# GitHub Actions on Windows sets TEMP to a shortname, and HOME to a
# longname. Eventually, filename comparisons fail because of the
# difference. Fix $TEMP.
echo $TEMP
if [ "$RUNNER_OS" == "Windows" ]; then
export TMP=$HOME\\AppData\\Local\\Temp
export TEMP=$HOME\\AppData\\Local\\Temp
fi
echo $TEMP
python -m tox
checks:
name: "Quality checks"
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: "actions/checkout@v2"
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.8"
- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install -r requirements.txt
- name: "Run check"
run: |
python -m tox -e check
- name: "Run pkgcheck"
run: |
python -m tox -e pkgcheck
- name: "Run doc"
run: |
python -m tox -e doc