forked from mdekauwe/CABLE_benchmarking
-
Notifications
You must be signed in to change notification settings - Fork 4
44 lines (39 loc) · 1.35 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: CI
on: [pull_request]
jobs:
pytest:
runs-on: ubuntu-latest
# This is required to activate conda environment in GitHub Actions:
# See https://stackoverflow.com/questions/72703363/how-to-activate-conda-environment-in-github-actions
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
with:
# Fetch all history for all tags and branches (tag information is
# required when building the conda package)
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: '3.9'
- name: Build and install conda package
run: |
conda install conda-build
conda build -c conda-forge -c accessnri -c coecms .
conda install --no-channel-priority -c $CONDA_PREFIX/conda-bld -c conda-forge -c accessnri -c coecms benchcab
conda uninstall conda-build
- name: Test with pytest
run: |
conda install pytest-cov
pytest
- name: Generate coverage reports
run: |
conda remove --force benchcab
pip install -e .
pytest --cov=./ --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml