Skip to content

[pre-commit.ci] pre-commit autoupdate #710

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #710

Workflow file for this run

name: Test
on:
pull_request:
paths-ignore:
- 'doc/**'
- 'README.*'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Python version number must be string, otherwise 3.10 becomes 3.1
- os: windows-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.9"
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: awvwgk/setup-fortran@main
id: setup-fortran
with:
compiler: gcc
version: 11
- run: python -m pip install --upgrade pip
# Remove after January 16th 2023 when GA switches to 14.2 by default
- if: ${{ matrix.os == 'macos-latest' }}
run: sudo xcode-select -s "/Applications/Xcode_14.2.app"
- if: ${{ matrix.os != 'windows-latest' }}
run: python -m pip install --prefer-binary -v .[test]
- if: ${{ matrix.os == 'windows-latest' }}
run: python -m pip install --prefer-binary -v .[test]
env:
CMAKE_GENERATOR: "MinGW Makefiles"
FC: ${{ steps.setup-fortran.outputs.fc }}
# graphviz is needed for tests, only install it when compilation succeed
- uses: tlylt/install-graphviz@v1
# Tests run in parallel, but data download is currently not thread-safe.
# We work around this by downloading all data files upfront.
- run: python download_data.py
- run: python -m pytest -vv -n 3
env:
no_proxy: '*'
# always() ensures upload even if pytest ends with failures
- if: always()
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.python-version }}
path: "fig/**"