-
Notifications
You must be signed in to change notification settings - Fork 25
292 lines (273 loc) · 9.83 KB
/
ci.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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
name: CI
on:
push:
pull_request:
jobs:
build-on-ubuntu:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.12
with:
cmake-version: '3.24.x'
- name: Checkout
uses: actions/checkout@v2
with:
path: wex
- name: Download wxWidgets
run: |
cd $HOME
python --version
python wex/.github/workflows/download_wx.py wx-3.2.3
dir
dir wx-3.2.3
echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV
chmod +x wx-3.2.3/bin/wx-config
sudo ln -s $HOME/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3
wx-config-3 --cflags | grep I
echo ${HOME}/wx-3.2.3/bin >> $GITHUB_PATH
- name: Install OS dependencies
run: |
sudo apt-get update --fix-missing
sudo apt-get install -y \
build-essential \
freeglut3-dev \
g++ \
libcurl4-openssl-dev \
libfontconfig-dev \
libgl1-mesa-dev \
libgtk2.0-dev \
mesa-common-dev \
unzip
# - name: Install wxWidgets
# run: |
# sudo apt-get install -y libwxgtk*-dev
# sudo ln -s $(which wx-config) /usr/local/bin/wx-config-3
# wx-config-3 --cflags | grep I
- name: Get git ref of sibling dependency LK
run: |
ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}')
echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency LK
uses: actions/cache@v2
id: cachedlk
with:
path: ${{ env.GH_WORKSPACE }}/lk
key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK
- name: Clone sibling dependency LK
if: steps.cachedlk.outputs.cache-hit == 'true'
uses: actions/checkout@v2
with:
ref: ${{ env.ref_of_lk }}
path: lk
repository: NREL/lk
- name: Build LK
if: steps.cachedlk.outputs.cache-hit == 'true'
run: |
ls
ls $WXMSW3
cd $GITHUB_WORKSPACE/lk
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux -j4
- name: Set env vars
run: |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV
echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV
- name: Get git ref of sibling dependency SSC
run: |
ref=$(git ls-remote --exit-code git://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}')
echo "ref_of_ssc=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency SSC
uses: actions/cache@v2
id: cachedssc
with:
path: ${{ env.GH_WORKSPACE }}/ssc
key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC
- name: Clone sibling dependency SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
ref: ${{ env.ref_of_ssc }}
path: ssc
repository: NREL/ssc
- name: Build WEX
run: |
cd $GITHUB_WORKSPACE/wex
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux
- name: Save static lib, Dview & wexsandbox
uses: actions/upload-artifact@v2
with:
name: WEX-linux-x86_64
path: |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/DView*
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/wexsandbox*
${{ env.GH_WORKSPACE }}/wex/build_linux/wex*.a
build-on-windows:
runs-on: windows-latest
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Checkout
uses: actions/checkout@v2
with:
path: wex
- name: Download wxWidgets
shell: bash
run: |
cd $HOME
python --version
python $GITHUB_WORKSPACE/wex/.github/workflows/download_wx.py wx-3.2.3
dir
dir wx-3.2.3
echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Get branch name
shell: bash
run: |
# Short name for current branch. base ref is set on push builds, head ref is for pull request builds
if [ -z ${GITHUB_HEAD_REF+x} ]; then GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}; else GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}; fi
echo "GIT_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV
- name: Determine branches for other repos
shell: bash
run: |
echo "GITHUB_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER}" >> $GITHUB_ENV
git ls-remote --heads --exit-code https://github.com/${GITHUB_REPOSITORY_OWNER}/lk.git $GIT_BRANCH
if [[ $? != "0" ]]; then echo "LK_BRANCH=develop" >> $GITHUB_ENV; else echo "LK_BRANCH=$GIT_BRANCH" >> $GITHUB_ENV; fi
- name: Checkout lk
uses: actions/checkout@v2
with:
path: lk
repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/lk
ref: ${{ env.LK_BRANCH }}
- name: Checkout ssc
uses: actions/checkout@v2
with:
path: ssc
repository: ${{ env.GITHUB_REPOSITORY_OWNER }}/ssc
ref: ${{ env.SSC_BRANCH }}
- name: Build LK
run: |
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release;Debug" -DCMAKE_SYSTEM_VERSION=10.0 -DSAM_SKIP_TOOLS=1 ..
MSBuild.exe .\lk.sln /t:Build /p:Configuration=Release
MSBuild.exe .\lk.sln /t:Build /p:Configuration=Debug
- name: Set LK paths
shell: bash
run: |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build/Release" >>$GITHUB_ENV
echo "LK_LIB=$GITHUB_WORKSPACE/lk/build/Release" >>$GITHUB_ENV
echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV
- name: Build WEX
run: |
cd $env:GITHUB_WORKSPACE/wex
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -DCMAKE_CONFIGURATION_TYPES="Release" -DCMAKE_SYSTEM_VERSION=10.0 ..
MSBuild.exe .\wex.sln /t:Build /p:Configuration=Release
- name: Save static lib, Dview & wexsandbox
uses: actions/upload-artifact@v2
with:
name: WEX-windows-x86_64
path: |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/DView*
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/wexsandbox*
${{ env.GH_WORKSPACE }}/wex/build_linux/wex*.a
build-on-mac:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14-large, macos-latest]
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
steps:
- name: Set relative paths
run: |
WXMSW3=$HOME/wx-3.2.3
echo "WXMSW3=$WXMSW3" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: Download wxWidgets
run: |
cd $HOME
python --version
pip install requests
python $GITHUB_WORKSPACE/.github/workflows/download_wx.py wx-3.2.3
ls
ls wx-3.2.3
echo "WXMSW3=$HOME/wx-3.2.3" >>$GITHUB_ENV
chmod +x wx-3.2.3/bin/wx-config
sudo ln -s $HOME/wx-3.2.3/bin/wx-config /usr/local/bin/wx-config-3
wx-config-3 --cflags | grep I
echo ${HOME}/wx-3.2.3/bin >> $GITHUB_PATH
- name: Get git ref of sibling dependency LK
run: |
ref=$(git ls-remote --exit-code git://github.com/NREL/lk.git refs/heads/develop | awk '{print $1}')
echo "ref_of_lk=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency LK
uses: actions/cache@v2
id: cachedlk
with:
path: ${{ env.GH_WORKSPACE }}/lk
key: ${{ env.RUNS_ON }}-${{ env.ref_of_lk }}-LK
- name: Clone sibling dependency LK
if: steps.cachedlk.outputs.cache-hit == 'true'
uses: actions/checkout@v2
with:
ref: ${{ env.ref_of_lk }}
path: lk
repository: NREL/lk
- name: Build LK
if: steps.cachedlk.outputs.cache-hit == 'true'
run: |
ls
ls $WXMSW3
cd $GITHUB_WORKSPACE/lk
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux -j4
- name: Set env vars
run: |
echo "LKDIR=$GITHUB_WORKSPACE/lk" >>$GITHUB_ENV
echo "LKD_LIB=$GITHUB_WORKSPACE/lk/build_linux" >>$GITHUB_ENV
echo "RAPIDJSONDIR=$GITHUB_WORKSPACE/ssc" >>$GITHUB_ENV
- name: Get git ref of sibling dependency SSC
run: |
ref=$(git ls-remote --exit-code git://github.com/NREL/ssc.git refs/heads/develop | awk '{print $1}')
echo "ref_of_ssc=$ref" | tee --append $GITHUB_ENV
- name: Get cached build data of sibling dependency SSC
uses: actions/cache@v2
id: cachedssc
with:
path: ${{ env.GH_WORKSPACE }}/ssc
key: ${{ env.RUNS_ON }}-${{ env.ref_of_ssc }}-SSC
- name: Clone sibling dependency SSC
if: steps.cachedssc.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
ref: ${{ env.ref_of_ssc }}
path: ssc
repository: NREL/ssc
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: '3.24.x'
- name: Build WEX
run: |
cmake -Bbuild_linux -DCMAKE_BUILD_TYPE=Debug
cmake --build build_linux
- name: Save static lib, Dview & wexsandbox
uses: actions/upload-artifact@v2
with:
name: WEX-${{ matrix.os }}-x86_64
path: |
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/DView*
${{ env.GH_WORKSPACE }}/wex/build_linux/tools/wexsandbox*
${{ env.GH_WORKSPACE }}/wex/build_linux/wex*.a