Speed up the algorithm analysis workflow #356
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: Unit tests | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
continue-on-error: false | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
# exclude: | |
# - os: macos-latest | |
# python-version: "3.7" | |
# - os: windows-latest | |
# python-version: "3.7" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
# You can test your matrix by printing the current Python version | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
- name: Cache pip | |
uses: actions/cache@v3 | |
id: pip-cache | |
with: | |
key: ${{ env.pythonLocation }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ${{ env.pythonLocation }} | |
if: steps.python-cache.outputs.cache-hit != 'true' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Test with pytest | |
run: | | |
python -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html | |