Skip to content

Commit

Permalink
Fancy ternary operator to pair Py3.7 with NumPy1.17 & Py3.9 with NumP…
Browse files Browse the repository at this point in the history
…y1.20
  • Loading branch information
weiji14 committed Mar 18, 2021
1 parent 1205006 commit 0453aa8
Showing 1 changed file with 10 additions and 25 deletions.
35 changes: 10 additions & 25 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.9]
os: [ubuntu-latest, macOS-latest, windows-latest]
# Is it a draft Pull Request (true or false)?
isDraft:
- ${{ github.event.pull_request.draft }}
# Only run one job (Ubuntu + Python 3.9) for draft PRs
include:
# Minimum NEP29 versions
- os: ubuntu-latest
python-version: '3.7'
numpy-version: '1.17'
isDraft: true
exclude:
- os: macOS-latest
python-version: '3.7'
numpy-version: '1.17'
isDraft: false
isDraft: true
- os: windows-latest
python-version: '3.7'
numpy-version: '1.17'
isDraft: false
# Maximum NEP29 versions
isDraft: true
- os: ubuntu-latest
python-version: '3.9'
numpy-version: '1.20'
python-version: 3.7
isDraft: true
- os: macOS-latest
python-version: '3.9'
numpy-version: '1.20'
isDraft: false
- os: windows-latest
python-version: '3.9'
numpy-version: '1.20'
isDraft: false
defaults:
run:
shell: bash -l {0}
Expand All @@ -69,6 +52,8 @@ jobs:
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
# Pair Python 3.7 with NumPy 1.17 and Python 3.9 with NumPy 1.20
NUMPY-VERSION: ${{ matrix.python-version == '3.7' && '1.17' || '1.20' }}

steps:
# Cancel previous runs that are not completed
Expand Down Expand Up @@ -96,8 +81,8 @@ jobs:
# Install GMT and other required dependencies from conda-forge
- name: Install dependencies
run: |
conda install gmt=6.1.1 numpy=${{ matrix.numpy-version }} pandas \
xarray netCDF4 packaging \
conda install gmt=6.1.1 numpy=${{ env.NUMPY-VERSION }} \
pandas xarray netCDF4 packaging \
codecov coverage[toml] ipython make \
pytest-cov pytest-mpl pytest>=6.0 \
sphinx-gallery
Expand Down

0 comments on commit 0453aa8

Please sign in to comment.