Merge pull request #167 from r1chardj0n3s/more-python-versions #1584
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: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# Run at 1:00 every day | |
- cron: '0 1 * * *' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# These versions match the minimum and maximum versions of pip in | |
# requirements.txt. | |
# An empty string here represents the latest version. | |
pip-version: ['==23.2', ''] | |
# The minimum version should be represented in setup.py. | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Set up Python" | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
# This is like the example but we use ``*requirements.txt`` rather | |
# than ``requirements.txt`` because we have multiple requirements | |
# files. | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --upgrade 'pip ${{ matrix.pip-version }}' | |
# We use '--ignore-installed' to avoid GitHub's cache which can cause | |
# issues - we have seen packages from this cache be cause trouble with | |
# pip-extra-reqs. | |
# | |
# We avoid "--upgrade" as we do version tests for the "pip" dependency. | |
python -m pip install --ignore-installed --editable .[dev] | |
- name: "Lint" | |
run: | | |
mypy . | |
ruff . | |
black --check . | |
pip-extra-reqs pip_check_reqs | |
pip-missing-reqs pip_check_reqs | |
pylint pip_check_reqs tests | |
- name: "Run tests" | |
run: | | |
pytest -s -vvv --cov-fail-under 100 --cov=pip_check_reqs/ --cov=tests tests/ | |
- name: "Upload coverage to Codecov" | |
uses: "codecov/codecov-action@v3" |