Allow CI workflow to be triggered manually #296
Workflow file for this run
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 | |
- pull_request | |
- workflow_dispatch | |
jobs: | |
ci: | |
runs-on: ${{ matrix.os }} | |
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.9"] | |
os: [ubuntu-latest, macos-latest] | |
pytest: | |
[ | |
"pytest>=4.6.0,<5.0.0", | |
"pytest>=5.0.0,<6.0.0", | |
"pytest>=6.0.0,<7.0.0", | |
"pytest>=7.0.0,<8.0.0", | |
] | |
exclude: | |
- python-version: "3.10" | |
pytest: "pytest>=4.6.0,<5.0.0" | |
- python-version: "3.10" | |
pytest: "pytest>=5.0.0,<6.0.0" | |
- python-version: "3.11" | |
pytest: "pytest>=4.6.0,<5.0.0" | |
- python-version: "3.11" | |
pytest: "pytest>=5.0.0,<6.0.0" | |
- python-version: "pypy-3.9" | |
os: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-v2-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ matrix.os }}-${{ matrix.python-version }}-v2- | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
python -m pip install "${{ matrix.pytest }}" | |
make install | |
- name: Test | |
shell: bash | |
run: | | |
make check test | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3.1.1 | |
with: | |
name: ${{ matrix.os }} Python ${{ matrix.python-version }} ${{ matrix.pytest }} |