-
Notifications
You must be signed in to change notification settings - Fork 8
170 lines (148 loc) · 6.06 KB
/
integration.yml
File metadata and controls
170 lines (148 loc) · 6.06 KB
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
name: Integration testing
on:
workflow_dispatch:
env:
GCC_V: 12
INTEL_V: 2021.7
jobs:
test_modflow:
name: MODFLOW 6 integration tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-14, macos-15-intel, windows-2022 ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repo
uses: actions/checkout@v5
with:
path: executables
- name: Checkout modflow6
uses: actions/checkout@v5
with:
repository: MODFLOW-ORG/modflow6
path: modflow6
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.1
with:
pixi-version: v0.41.4
manifest-path: modflow6/pixi.toml
- name: Custom pixi install
working-directory: modflow6
run: pixi run install
- name: Setup ${{ contains(fromJSON('["macOS"]'), runner.os) && 'gcc' || 'intel-classic' }} ${{ contains(fromJSON('["macOS"]'), runner.os) && env.GCC_V || env.INTEL_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ contains(fromJSON('["macOS"]'), runner.os) && 'gcc' || 'intel-classic' }}
version: ${{ contains(fromJSON('["macOS"]'), runner.os) && env.GCC_V || env.INTEL_V }}
- name: Setup Xcode CLT (macOS)
uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
with:
xcode-version: 'latest'
- name: Set LDFLAGS (macOS)
if: runner.os == 'macOS'
run: |
ldflags="$LDFLAGS -Wl,-ld_classic"
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
- name: Hide dylibs (macOS)
if: runner.os == 'macOS'
run: |
version=${{ env.GCC_V }}
brew_prefix="$(brew --prefix)"
libpath="$brew_prefix/opt/gcc@$version/lib/gcc/$version"
mv $libpath/libgcc_s.1.1.dylib $libpath/libgcc_s.1.1.dylib.bak
mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak
mv $libpath/libquadmath.0.dylib $libpath/libquadmath.0.dylib.bak
mv $libpath/libstdc++.6.dylib $libpath/libstdc++.6.dylib.bak
# only necessary because we need mf5to6 for mf6 autotests
- name: Build modflow6
working-directory: modflow6
run: |
setupargs="--prefix=$(pwd) --libdir=bin -Ddebug=false"
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
setupargs="$setupargs -Doptimization=1"
fi
pixi run build builddir $setupargs
- name: Get OS tag
id: ostag
run: |
ostag=$(pixi run --manifest-path modflow6/pixi.toml python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
echo "ostag=$ostag" >> $GITHUB_OUTPUT
- name: Fetch pre-built programs
working-directory: executables
run: |
ostag="${{ steps.ostag.outputs.ostag }}"
mkdir $ostag
pixi run --manifest-path ../modflow6/pixi.toml python scripts/fetch_releases.py --manifest releases.json --ostag $ostag --outdir $ostag --zip $ostag.zip
- name: Build programs
uses: nick-fields/retry@v3
with:
shell: bash
timeout_minutes: 40
command: |
ostag="${{ steps.ostag.outputs.ostag }}"
fetched=$(pixi run --manifest-path modflow6/pixi.toml python executables/scripts/fetch_releases.py --manifest executables/releases.json --list)
pixi run --manifest-path modflow6/pixi.toml make-program : --appdir executables/$ostag --exclude "$fetched" --zip executables/$ostag.zip --verbose
pixi run --manifest-path modflow6/pixi.toml make-program mf2005,mflgr,mfnwt,mfusg --appdir executables/$ostag --double --keep --zip executables/$ostag.zip --verbose
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
pixi run --manifest-path modflow6/pixi.toml make-program mf6 --appdir executables/$ostag --keep --zip executables/$ostag.zip --verbose --fflags='-O1'
fi
pixi run --manifest-path modflow6/pixi.toml make-code-json --appdir executables/$ostag --zip executables/$ostag.zip --verbose
- name: Move programs
run: |
# build programs
ostag="${{ steps.ostag.outputs.ostag }}"
# move programs where mf6 autotests expect them
mkdir modflow6/bin/downloaded
cp executables/$ostag/* modflow6/bin/downloaded
# move mf6 binaries to top-level bindir in mf6 repo
if [[ "$RUNNER_OS" == "Windows" ]]; then
eext=".exe"
oext=".dll"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
eext=""
oext=".so"
else
eext=""
oext=".dylib"
fi
cp "executables/$ostag/mf6$eext" modflow6/bin
cp "executables/$ostag/libmf6$oext" modflow6/bin
cp "executables/$ostag/zbud6$eext" modflow6/bin
# set execute permissions
if [[ "$RUNNER_OS" != "Windows" ]]; then
sudo chmod +x modflow6/bin/*
sudo chmod +x modflow6/bin/downloaded/*
fi
- name: Show programs
run: |
ostag="${{ steps.ostag.outputs.ostag }}"
ls executables/$ostag
- name: Check linked libs (macOS)
if: runner.os == 'macOS'
run: |
ostag="${{ steps.ostag.outputs.ostag }}"
find executables/$ostag -perm +111 -type f | xargs -I{} sh -c "otool -L {}"
- name: Upload programs
uses: actions/upload-artifact@v4
with:
name: ${{ steps.ostag.outputs.ostag }}
path: executables/${{ steps.ostag.outputs.ostag }}.zip
- name: Upload metadata
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.ostag.outputs.ostag }}
path: |
executables/code.json
executables/code.md
- name: Update flopy
working-directory: modflow6
run: pixi run update-flopy
- name: Test modflow6
working-directory: modflow6
run: pixi run autotest -m "not developmode"