Skip to content

Commit 1ad304e

Browse files
gselzerctrueden
authored andcommitted
Improve conda test and code coverage
1 parent 07a6fea commit 1ad304e

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,33 +61,32 @@ jobs:
6161
- uses: actions/checkout@v2
6262
- uses: psf/black@stable
6363

64-
coverage:
64+
conda-dev-test:
65+
name: Conda Setup & Code Coverage
6566
runs-on: ubuntu-latest
67+
defaults:
68+
# Steps that rely on the activated environment must be run with this shell setup.
69+
# See https://github.com/marketplace/actions/setup-miniconda#important
70+
run:
71+
shell: bash -l {0}
6672
steps:
6773
- uses: actions/checkout@v2
6874
- uses: conda-incubator/setup-miniconda@v2
6975
with:
76+
# Create env with dev packages
7077
auto-update-conda: true
71-
python-version: ${{ matrix.python-version }}
72-
- name: Add conda to system path
78+
python-version: 3.9
79+
environment-file: dev-environment.yml
80+
# Activate imglyb-dev environment
81+
activate-environment: imglyb-dev
82+
auto-activate-base: false
83+
# Use mamba for faster setup
84+
use-mamba: true
85+
mamba-version: "*"
86+
- name: Test imglyb
7387
run: |
74-
# $CONDA is an environment variable pointing to the root of the miniconda directory
75-
echo $CONDA/bin >> $GITHUB_PATH
76-
- name: Install mamba
77-
run: |
78-
conda install -c conda-forge mamba
79-
- name: Install dependencies
80-
run: |
81-
mamba env update --file dev-environment.yml --name base
82-
- name: Install current project in dev mode
83-
run: |
84-
pip install -e .
85-
- name: Install pytest
86-
run: |
87-
mamba install -c conda-forge pytest-cov
88-
- name: Generate Report
89-
run: |
90-
python -m pytest --cov-report=xml --cov=.
88+
python -m pytest tests/ -p no:faulthandler --cov-report=xml --cov=.
89+
# We could do this in its own action, but we'd have to setup the environment again.
9190
- name: Upload Coverage to Codecov
9291
uses: codecov/codecov-action@v2
9392

0 commit comments

Comments
 (0)