Fix pypi upload #791
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: 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 | |
# Disable Windows for now, as long as numpy is buggy on Windows | |
# - os: windows-latest | |
# python-version: "3.12" | |
# installs: "numpy==1.26.4" | |
- os: macos-14 | |
python-version: "3.12" | |
installs: "numpy>=2" | |
- os: ubuntu-latest | |
python-version: "3.13" | |
installs: "numpy>=2" | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 3 | |
- name: Get latest CMake and Ninja | |
uses: lukka/get-cmake@latest | |
# must come after checkout | |
- uses: hendrikmuhs/[email protected] | |
with: | |
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.python-version }} | |
- uses: astral-sh/setup-uv@v3 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
allow-prereleases: true | |
- uses: awvwgk/setup-fortran@main | |
id: setup-fortran | |
with: | |
compiler: gcc | |
version: 13 | |
- run: python -m pip install --upgrade pip | |
- if: ${{ matrix.os != 'windows-latest' }} | |
run: uv pip install --system -v .[test] ${{ matrix.installs }} | |
- if: ${{ matrix.os == 'windows-latest' }} | |
run: python -m pip install --prefer-binary -v .[test] ${{ matrix.installs }} | |
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/**" |