forked from neuralhydrology/neuralhydrology
-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (38 loc) · 1.13 KB
/
pytest-ci.yml
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
45
46
# Workflow to run the pytest test suite.
name: pytest CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
# Checkout the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
# initialize conda
- name: Conda setup
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: '3.10'
# cache the conda installation to speedup the CI runs
- uses: actions/cache@v3
id: cache
with:
path: /usr/share/miniconda/envs/neuralhydrology
key: ${{ runner.os }}-conda-cache-${{ hashFiles('environments/environment_cpu.yml') }}
# on cache miss, create the env from scratch
- name: Conda environment creation
if: steps.cache.outputs.cache-hit != 'true'
run: |
conda env create -f environments/environment_cpu.yml
source activate neuralhydrology
# Run the tests
- name: Testing with pytest
run: |
source activate neuralhydrology
pytest --cov=neuralhydrology