This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
193 lines (167 loc) · 5.76 KB
/
integration.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Integration testing
on:
push:
branches:
- main
- develop*
paths-ignore:
- '**.md'
pull_request:
branches:
- main
- develop
paths-ignore:
- '**.md'
schedule:
- cron: '0 6 * * *' # run at 6 AM UTC every day
jobs:
test_modflow:
name: Test modflow6 integration
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
env: [ pip, miniconda, micromamba ]
defaults:
run:
shell:
# necessary for miniconda and micromamba
# https://github.com/mamba-org/provision-with-micromamba#important
bash -l {0}
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Checkout modflow6
uses: actions/checkout@v3
with:
repository: MODFLOW-USGS/modflow6
path: modflow6
- name: Setup Python
if: matrix.env == 'pip'
uses: actions/setup-python@v4
with:
python-version: 3.9
cache: 'pip'
- name: Install Python dependencies
if: matrix.env == 'pip'
shell: bash
run: pip install -r test/requirements.txt
- name: Install miniconda environment
if: matrix.env == 'miniconda'
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: modflow6/environment.yml
- name: Install micromamba environment
if: matrix.env == 'micromamba'
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: modflow6/environment.yml
cache-downloads: true
cache-env: true
- name: Install ifort
uses: ./
with:
path: ${{ runner.os != 'Windows' && 'bin' || 'C:\Program Files (x86)\Intel\oneAPI' }}
- name: Build modflow6 (Linux & Mac)
if: runner.os != 'Windows' && matrix.env == 'pip'
working-directory: modflow6
shell: bash
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson compile -v -C builddir
meson install -C builddir
- name: Build modflow6 (Linux & Mac)
if: runner.os != 'Windows' && matrix.env != 'pip'
working-directory: modflow6
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson compile -v -C builddir
meson install -C builddir
- name: Add micromamba Scripts dir to path (Windows)
if: runner.os == 'Windows' && matrix.env == 'micromamba'
shell: pwsh
run: |
# adding micromamba scripts dir to system path
$mamba_bin = "C:\Users\runneradmin\micromamba-root\envs\modflow6\Scripts"
if (Test-Path $mamba_bin) {
echo "adding micromamba scripts dir to path: $mamba_bin"
echo $mamba_bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
}
- name: Build modflow6 (Windows bash)
if: runner.os == 'Windows'
continue-on-error: true
working-directory: modflow6
shell: bash -l {0}
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin
meson compile -v -C builddir
meson install -C builddir
- name: Show meson build log
run: cat modflow6/builddir/meson-logs/meson-log.txt
- name: Build modflow6 (Windows pwsh)
if: runner.os == 'Windows'
continue-on-error: true
working-directory: modflow6
shell: pwsh
run: |
meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin --wipe
meson compile -v -C builddir
meson install -C builddir
- name: Build modflow6 (Windows cmd)
if: runner.os == 'Windows'
working-directory: modflow6
shell: cmd /C call {0}
run: |
meson setup builddir -Ddebug=false --prefix=%CD% --libdir=bin --wipe
meson compile -v -C builddir
meson install -C builddir
test_pymake:
name: Test pymake integration
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# windows-2022 runners have Visual Studio 17.4.*, which oneapi toolchain doesn't support yet
os: [ ubuntu-latest, macos-latest, windows-2019 ]
defaults:
run:
shell: bash
steps:
- name: Checkout action
uses: actions/checkout@v3
- name: Checkout pymake
uses: actions/checkout@v3
with:
repository: modflowpy/pymake
path: pymake
- name: Setup Graphviz
if: runner.os == 'Linux'
uses: ts-graphviz/setup-graphviz@v1
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.9
- name: Install Python packages
working-directory: pymake
run: .github/common/install-python.sh
- name: Setup oneAPI compilers
uses: ./
with:
path: ${{ runner.os != 'Windows' && 'bin' || 'C:\Program Files (x86)\Intel\oneAPI' }}
- name: Download examples
working-directory: pymake
run: .github/common/download-examples.sh
- name: Test (Linux)
if: runner.os == 'Linux'
working-directory: pymake
run: pytest -v -n=auto --dist=loadfile -m="base or regression" --durations=0 --cov=pymake --cov-report=xml autotest/
- name: Test (MacOS)
if: runner.os == 'macOS'
working-directory: pymake
run: pytest -v -n=auto --dist=loadfile -m="base" --durations=0 --cov=pymake --cov-report=xml autotest/
- name: Test (Windows)
if: runner.os == 'Windows'
working-directory: pymake
shell: cmd
run: pytest -v -m="base" --durations=0 --cov=pymake --cov-report=xml autotest/