-
Notifications
You must be signed in to change notification settings - Fork 101
106 lines (93 loc) · 3.16 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: pyemu continuous integration
on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 AM PST, 8 PM NZST)
push:
pull_request:
jobs:
pyemuCI:
name: autotests
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest] # , macos-latest]
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
run-type: [std]
test-path: ["."]
include:
- os: macos-latest
python-version: 3.11
steps:
- name: Checkout repo
uses: actions/checkout@v4 # checksout this repo
- name: Set Windows ENV
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
# Setup conda env
- name: Install Conda environment using micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: etc/environment.yml
environment-name: pyemu
create-args: >-
python=${{ matrix.python-version }}
cache-downloads: true
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
- name: Install pyemu
shell: bash -l {0}
run: |
pip install -e .
micromamba list
- name: Install Modflow executables
uses: modflowpy/install-modflow-action@v1
- name: Add executables directory to path
shell: bash
run: |
echo "$MODFLOW_BIN_PATH" >> $GITHUB_PATH
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo $GITHUB_PATH
# order matters for this step - after setting path to executables
- name: Install PEST++ suite using get-pestpp
shell: bash -l {0}
run: |
get-pestpp :home
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test-path }}
shell: bash -l {0}
working-directory: ./autotest
run: |
pytest -rP -rx --capture=no -v -n=auto --tb=native --cov=pyemu --cov-report=lcov ${{ matrix.test-path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test Notebooks
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == 3.11 }}
shell: bash -l {0}
working-directory: ./examples
run: |
micromamba install --name pyemu jupyter jupytext
pytest -v -rP -rx --capture=no -n=auto --nbmake --cov=pyemu --cov-report=lcov:../autotest/coverage.lcov \
--cov-config=../autotest/.coveragerc *.ipynb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.test-path }}
parallel: true
path-to-lcov: autotest/coverage.lcov
coveralls_finish:
needs: pyemuCI
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
path-to-lcov: autotest/coverage.lcov