Fix conditional for release. #9
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: CI | |
on: | |
pull_request: | |
push: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
# Many color libraries just need this to be set to any value, but at least | |
# one distinguishes color depth, where "3" -> "256-bit color". | |
FORCE_COLOR: 3 | |
jobs: | |
checks: | |
name: Check Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
env: | |
IGNORE_CONDA: true | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04, macos-latest, windows-latest ] | |
python-version: [ "3.9", "3.10", "3.11", "3.12" ] | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Use msmpi on windows | |
- uses: mpi4py/setup-mpi@v1 | |
if: ${{ contains(matrix.os, 'windows') }} | |
with: | |
mpi: msmpi | |
# Else, use the default for the OS and setup-mpi action | |
- uses: mpi4py/setup-mpi@v1 | |
if: ${{ !contains(matrix.os, 'windows') }} | |
# Setup openmp on macOS | |
- name: Install openmp if on macos | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: | | |
brew install libomp llvm | |
- name: Upgrade pip | |
run: | | |
python3 -m pip install -U pip | |
- name: Run tests and other checks | |
if: runner.os == 'Linux' | |
run: | | |
./pr-check.sh | |
- name: Run tests and other checks | |
if: runner.os == 'macOS' | |
run: | | |
export CLANG_PREFIX=$(brew --prefix llvm) | |
export CC=$CLANG_PREFIX/bin/clang | |
export CXX=$CLANG_PREFIX/bin/clang++ | |
./pr-check.sh | |
# On window, just install the package and run tests for now, we need to port the pr-check script to windows | |
- name: Run tests and other checks | |
if: runner.os == 'Windows' | |
run: | | |
python -m pip install .[all] -v | |
python -m pytest -v | |
# - uses: codecov/codecov-action@v1 |