Numpy 2 #74
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: pytest | |
on: [push, pull_request] | |
jobs: | |
cache_test_images: | |
name: cache test images | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prevent cache-miss on windows | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Load test images from cache | |
id: cache-test-images | |
uses: actions/cache@v4 | |
with: | |
key: test-images-cache-${{ hashFiles('tests/download_test_images.py') }} | |
path: tests/testdata/slides | |
enableCrossOsArchive: true | |
- name: Download test images | |
if: ${{ steps.cache-test-images.outputs.cache-hit != 'true' }} | |
run: python tests/download_test_images.py | |
tests: | |
needs: [cache_test_images] | |
name: pytest ${{ matrix.os }}::py${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 6 | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- name: Prevent cache-miss on windows | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Load test images from cache | |
uses: actions/cache@v4 | |
with: | |
key: test-images-cache-${{ hashFiles('tests/download_test_images.py') }} | |
path: tests/testdata/slides | |
enableCrossOsArchive: true | |
fail-on-cache-miss: true | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install poetry | |
- name: Install Application | |
run: python -m poetry install --all-extras | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
python -m poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
python -m poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics | |
- name: Test with pytest. | |
run: python -m poetry run pytest |