Skip to content

Commit

Permalink
Fix CI prematurely ending
Browse files Browse the repository at this point in the history
  • Loading branch information
ifd3f committed Jan 8, 2022
1 parent a782eb8 commit f06912c
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,43 @@ 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"
pull_request:
branches:
- "master"
push: {}
pull_request: {}
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:
# TODO: set up documentation tests
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
name: Test MDSAPT on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest]
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2

# Cache our conda packages.
# More info: https://github.com/conda-incubator/setup-miniconda#caching-packages
- name: Cache conda environment
uses: actions/cache@v2
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('mdsapt_env.yaml') }}

# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v2
- name: Set up Anaconda environment
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
Expand All @@ -38,24 +49,21 @@ jobs:
auto-update-conda: false
auto-activate-base: false

- name: Install package

- name: Install MDSAPT package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
conda list
- name: Run tests

# conda setup requires this special shell
shell: bash -l {0}

run: |
pytest -v ./MDSAPT
pytest -v ./mdsapt
- name: CodeCov
# TODO: set up code coverage to work correctly
- name: Run CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
Expand Down

0 comments on commit f06912c

Please sign in to comment.