-
Notifications
You must be signed in to change notification settings - Fork 9
261 lines (224 loc) · 9.08 KB
/
compile.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# This is a basic workflow to help you get started with Actions
name: Compile Mac, Ubuntu, Windows
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains four jobs called "macOS","ubuntu20", "ubuntu22" and "windows"
ubuntu20:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
# Runs a single command using the runners shell
- name: Getting packages
run: |
sudo apt-get update -y
sudo apt-get install libnetcdf-dev
sudo apt-get install libgd3
sudo apt-get -y --allow-downgrades install libgd3=2.2.5-5.2ubuntu2.1
sudo apt-get install libgd-dev
sudo apt-get install gfortran
sudo apt-get install devscripts
sudo apt-get install debhelper
# Runs a set of commands using the runners shell
- name: compile GLM
run: |
cd $GITHUB_WORKSPACE/glm-source
chmod u+x ./admin/make_release_info.sh
./build_glm.sh
mkdir -p $GITHUB_WORKSPACE/binaries/ubuntu/20.04
cp -r $GITHUB_WORKSPACE/glm-source/binaries/ubuntu/20.04/* $GITHUB_WORKSPACE/binaries/ubuntu/20.04/.
- name: run GLM FCR
run: |
cd glm-examples/FCR
$GITHUB_WORKSPACE/glm-source/GLM/glm
- name: run GLM Woods
run: |
cd glm-examples/Woods
$GITHUB_WORKSPACE/glm-source/GLM/glm
- name: run GLM Sparkling
run: |
cd glm-examples/Sparkling
$GITHUB_WORKSPACE/glm-source/GLM/glm
- name: run GLM Gross Dhuenn
run: |
cd glm-examples/GrosseDhuenn
$GITHUB_WORKSPACE/glm-source/GLM/glm
- name: run GLM Lake Alex
run: |
cd glm-examples/LakeAlexandrina
$GITHUB_WORKSPACE/glm-source/GLM/glm
#- uses: r-lib/actions/setup-pandoc@v2
#- uses: r-lib/actions/setup-r@v2
#- uses: r-lib/actions/setup-renv@v2
#- name: Run test and generate plots
# run: |
# cd glm-examples
# R -e 'source("install.R")'
# R -e 'install.packages("rmarkdown")'
# R -e 'rmarkdown::render("example_lakes.Rmd")'
# mv $GITHUB_WORKSPACE/glm-examples/example_lakes.md $GITHUB_WORKSPACE/glm-examples/README.md
- name: update binaries and push to remote
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git pull
git add -A
git commit -m "Update Ubuntu 20.04 binaries"
git push
ubuntu22:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
# Runs a single command using the runners shell
- name: Getting packages
run: |
sudo apt-get update -y
sudo apt-get install libnetcdf-dev
sudo apt-get install libgd3
sudo apt-get install libgd-dev
sudo apt-get install gfortran
sudo apt-get install devscripts
sudo apt-get install debhelper
# Runs a set of commands using the runners shell
- name: compile GLM
run: |
cd $GITHUB_WORKSPACE/glm-source
chmod u+x ./admin/make_release_info.sh
./build_glm.sh
mkdir -p $GITHUB_WORKSPACE/binaries/ubuntu/22.04
cp -r $GITHUB_WORKSPACE/glm-source/binaries/ubuntu/22.04/* $GITHUB_WORKSPACE/binaries/ubuntu/22.04/.
- name: update binaries and push to remote
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git pull
git add -A
git commit -m "Update Ubuntu 22.04 binaries"
git push
macOS-M:
# The type of runner that the job will run on
runs-on: macos-12
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install packages
run: |
brew reinstall gcc
brew install netcdf
brew install gd
- name: compile GLM
run: |
cd $GITHUB_WORKSPACE/glm-source
./build_glm.sh
MOSDIR=`grep 'SOFTWARE LICENSE AGREEMENT FOR ' '/System/Library/CoreServices/Setup Assistant.app/Contents/Resources/en.lproj/OSXSoftwareLicense.rtf' | awk -F 'macOS ' '{print $NF}' | tr -d '\\' | tr ' ' '_'`
mkdir -p $GITHUB_WORKSPACE/binaries/macos/${MOSDIR}
cp -r $GITHUB_WORKSPACE/glm-source/binaries/macos/${MOSDIR}/* $GITHUB_WORKSPACE/binaries/macos/${MOSDIR}/.
- name: update binaries and push to remote
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git pull
git add -A
git commit -m "Update MacOS binaries"
git push
macOS-S:
# The type of runner that the job will run on
runs-on: macos-14
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install packages
run: |
brew reinstall gcc
brew install netcdf
brew install gd
- name: compile GLM
run: |
cd $GITHUB_WORKSPACE/glm-source
./build_glm.sh
MOSDIR=`grep 'SOFTWARE LICENSE AGREEMENT FOR ' '/System/Library/CoreServices/Setup Assistant.app/Contents/Resources/en.lproj/OSXSoftwareLicense.rtf' | awk -F 'macOS ' '{print $NF}' | tr -d '\\' | tr ' ' '_'`
mkdir -p $GITHUB_WORKSPACE/binaries/macos/${MOSDIR}
cp -r $GITHUB_WORKSPACE/glm-source/binaries/macos/${MOSDIR}/* $GITHUB_WORKSPACE/binaries/macos/${MOSDIR}/.
- name: update binaries and push to remote
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git pull
git add -A
git commit -m "Update MacOS binaries"
git push
windows:
# The type of runner that the job will run on
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Checkout submodules
run: |
git submodule update --init --recursive
- name: Install packages
run: |
choco install make
choco install mingw
choco install git
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- name: compile GLM
shell: bash
run: |
cd $GITHUB_WORKSPACE/glm-source/ancillary/windows/Sources
./build_all.sh
cd $GITHUB_WORKSPACE/glm-source
./build_glm.sh
mkdir -p $GITHUB_WORKSPACE/binaries/windows
cd $GITHUB_WORKSPACE/glm-source/binaries/windows
cp -r * $GITHUB_WORKSPACE/binaries/windows
# - name: run GLM FCR
# shell: bash
# run: |
# cd glm-examples/FCR
# echo now try running glm
# $GITHUB_WORKSPACE/binaries/windows/glm_latest/glm.exe
# echo run completed
- name: update binaries and push to remote
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git pull
git add -A
git commit -m "Update Windows binaries"
git push