-
Notifications
You must be signed in to change notification settings - Fork 15
67 lines (54 loc) · 1.8 KB
/
test_stable.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Test stable
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
Test:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest" ] #, "macos-latest", "windows-latest"]
python-version: ['3.10']
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/hydromt_wflow
name: ${{ matrix.label }} - py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.python-version }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: hydromt_wflow
use-mamba: true
- name: Generate env spec
run: pip install tomli && python make_env.py test --py-version ${{ matrix.python-version }}.*
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('environment.yml') }}-${{ env.DATE }}
id: cache
- name: Update environment
run: mamba env update -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Install HydroMT-Wflow plugin
run: pip install .
- name: Run tests
run: python -m pytest --verbose --cov=hydromt_wflow --cov-report xml
- name: Upload code coverage
uses: codecov/codecov-action@v3