forked from modflowpy/flopy
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (113 loc) · 3.75 KB
/
mf6.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Modflow6 continuous integration
on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
push:
pull_request:
branches:
- master
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test_mf6:
name: Modflow6 FloPy tests
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout flopy repo
uses: actions/checkout@v4
- name: Setup Python
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
- name: Install FloPy
run: uv sync --all-extras
- name: Install other dependencies from GitHub
run: uv pip install -r etc/requirements.mf6.txt
- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: 13
- name: Checkout MODFLOW 6
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6
path: modflow6
- name: Build and install MF6
working-directory: modflow6
run: |
uv run meson setup builddir --buildtype=debugoptimized --prefix=$(pwd) --libdir=bin
uv run meson install -C builddir
uv run meson test --verbose --no-rebuild -C builddir
- name: Update package classes
working-directory: modflow6/autotest
run: uv run update_flopy.py
- name: Install executables
working-directory: modflow6/autotest
env:
GITHUB_TOKEN: ${{ github.token }}
run: uv run pytest -v --durations=0 get_exes.py
- name: Run tests
working-directory: modflow6/autotest
run: uv run pytest -v --cov=flopy --cov-report=xml --cov-append --durations=0 -n auto -m "not repo and not regression"
- name: Print coverage report before upload
working-directory: ./modflow6/autotest
run: uv run coverage report
- name: Upload coverage to Codecov
if:
github.repository_owner == 'modflowpy' && (github.event_name == 'push' || github.event_name == 'pull_request')
uses: codecov/codecov-action@v5
with:
files: ./modflow6/autotest/coverage.xml
test_mf6_examples:
name: MF6 examples FloPy tests
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout flopy repo
uses: actions/checkout@v4
- name: Checkout MODFLOW 6
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6
path: modflow6
- name: Checkout MF6 examples
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples
- name: Setup Python
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
- name: Install FloPy
run: uv sync --all-extras
- name: Install other dependencies from modflow6-examples and GitHub
run: uv pip install -r etc/requirements.mf6.txt -r modflow6-examples/etc/requirements.pip.txt
- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: 13
- name: Install executables
uses: modflowpy/install-modflow-action@v1
- name: Build and install MF6
working-directory: modflow6
run: |
uv run meson setup builddir --buildtype=debugoptimized --prefix=$(pwd) --libdir=bin
uv run meson install -C builddir
uv run meson test --verbose --no-rebuild -C builddir
cp bin/* ~/.local/bin/modflow/
- name: Update package classes
working-directory: modflow6/autotest
run: uv run update_flopy.py
- name: Test MF6 examples
working-directory: modflow6-examples/autotest
run: uv run pytest -v -n=auto --durations=0 test_scripts.py