forked from MODFLOW-ORG/executables
-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (138 loc) · 5.34 KB
/
Copy pathintegration.yml
File metadata and controls
159 lines (138 loc) · 5.34 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
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-13, macos-14, windows-2022 ]
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
path: executables
- name: Checkout modflow6
uses: actions/checkout@v4
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-14"]'), matrix.os) && 'gcc' || 'intel-classic' }} ${{ contains(fromJSON('["macos-14"]'), matrix.os) && env.GCC_V || env.INTEL_V }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ contains(fromJSON('["macos-14"]'), matrix.os) && 'gcc' || 'intel-classic' }}
version: ${{ contains(fromJSON('["macos-14"]'), matrix.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: ${{ contains(fromJSON('["macos-13"]'), matrix.os) && '14.3.1' || 'latest' }}
- name: Set LDFLAGS (ARM macOS)
run: |
ldflags="$LDFLAGS -Wl,-ld_classic"
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
- name: Hide dylibs (ARM macOS)
if: matrix.os == 'macos-14'
run: |
libpath="/opt/homebrew/opt/gcc@${{ env.GCC_V }}/lib/gcc/${{ env.GCC_V }}"
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: Build programs
uses: nick-fields/retry@v3
with:
shell: bash
timeout_minutes: 40
command: |
ostag="${{ steps.ostag.outputs.ostag }}"
mkdir $ostag
pixi run --manifest-path modflow6/pixi.toml make-program : --appdir $ostag --exclude gridgen --zip $ostag.zip --verbose
pixi run --manifest-path modflow6/pixi.toml make-program mf2005,mflgr,mfnwt,mfusg --appdir $ostag --double --keep --zip $ostag.zip --verbose
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
pixi run --manifest-path modflow6/pixi.toml make-program mf6 --appdir $ostag --keep --zip $ostag.zip --verbose --fflags='-O1'
fi
pixi run --manifest-path modflow6/pixi.toml make-code-json --appdir $ostag --zip $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 $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 "$ostag/mf6$eext" modflow6/bin
cp "$ostag/libmf6$oext" modflow6/bin
cp "$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 $ostag
- name: Check linked libs (ARM macOS)
if: matrix.os == 'macos-14'
run: |
ostag="${{ steps.ostag.outputs.ostag }}"
find $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: ${{ steps.ostag.outputs.ostag }}.zip
- name: Upload metadata
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: ${{ steps.ostag.outputs.ostag }}
path: |
./code.json
./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"