CI #972
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: | |
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming | |
# Existing codes likely still have "master" as the primary branch | |
# Both are tracked here to keep legacy and new codes working | |
push: | |
branches: | |
- "master" | |
- "main" | |
pull_request: | |
branches: | |
- "master" | |
- "main" | |
schedule: | |
# Nightly tests run on master by default: | |
# Scheduled workflows run on the latest commit on the default or base branch. | |
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule) | |
- cron: "0 0 * * *" | |
jobs: | |
test: | |
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }} | |
timeout-minutes: 60 | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.allow-failure }} | |
strategy: | |
matrix: | |
# As of Jul 4, 2024, GitHub has switched macOS-latest to use the M1 | |
# architecture but this is causing problems with some packages. | |
# os: [macOS-latest, ubuntu-latest] | |
os: [macOS-13, ubuntu-latest] | |
python-version: [3.9, "3.10", "3.11"] | |
allow-failure: [false] | |
#include: | |
#- os: windows-latest | |
# python-version: [3.9, "3.10", "3.11"] | |
# allow-failure: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Additional info about the build | |
shell: bash | |
run: | | |
uname -a | |
df -h | |
ulimit -a | |
# More info on options: https://github.com/mamba-org/setup-micromamba | |
- uses: mamba-org/setup-micromamba@v1 | |
env: | |
# Without this I get "Download error (28) Timeout was reached" | |
MAMBA_NO_LOW_SPEED_LIMIT: 1 | |
with: | |
# conda-forge is the default channel so we don't specify channels | |
environment-file: devtools/conda-envs/test_env.yaml | |
environment-name: test | |
create-args: >- | |
python=${{ matrix.python-version }} | |
- name: Install package | |
# conda setup requires this special shell | |
shell: bash -l {0} | |
run: | | |
python -m pip install -e . --no-deps | |
micromamba list | |
- name: Run tests | |
# conda setup requires this special shell | |
shell: bash -l {0} | |
run: | | |
pytest -v --cov=tfep --cov-report=xml --color=yes --durations=50 tfep/tests/ | |
- name: Run doctests | |
# conda setup requires this special shell | |
shell: bash -l {0} | |
run: | | |
pytest -v --doctest-modules --ignore=tfep/tests/ | |
- name: CodeCov | |
# There is no need to re-run codecov multiple times | |
if: contains(matrix.os, 'ubuntu') | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./coverage.xml | |
flags: unittests | |
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }} |