-
Notifications
You must be signed in to change notification settings - Fork 115
247 lines (215 loc) · 7.78 KB
/
simulators.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
# Nimbus
# Copyright (c) 2021-2024 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
# https://www.apache.org/licenses/LICENSE-2.0)
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or
# https://opensource.org/licenses/MIT)
# at your option. This file may not be copied, modified, or distributed except
# according to those terms.
name: Simulators
on:
schedule:
# every two days 11 PM
- cron: "0 23 */2 * *"
workflow_dispatch:
jobs:
build-linux-amd64:
name: Linux-amd64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get latest nimbus-build-system commit hash
id: versions
run: |
sudo apt-get -q update
sudo apt-get install -y librocksdb-dev libpcre3-dev
getHash() {
git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
}
nbsHash=$(getHash status-im/nimbus-build-system)
echo "nimbus_build_system=$nbsHash" >> $GITHUB_OUTPUT
- name: Restore prebuilt Nim from cache
uses: actions/cache@v4
with:
path: NimBinaries
key: 'nim-linux-amd64-${{ steps.versions.outputs.nimbus_build_system }}-sim'
- name: Build Nim and deps
run: |
ncpu=$(nproc)
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
make -j${ncpu} deps
- name: Run Simulators
run: |
SIM_SCRIPT="hive_integration/nodocker/build_sims.sh"
chmod +x ${SIM_SCRIPT}
${SIM_SCRIPT} "Linux-amd64"
- name: Upload artefact
uses: actions/upload-artifact@v4
with:
name: linux_amd64_stat
path: ./simulators.md
retention-days: 2
build-macos-amd64:
name: Macos-amd64
runs-on: macos-12
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Restore rocksdb from cache
id: rocksdb-cache
uses: actions/cache@v4
with:
path: rocks-db-cache
key: 'rocksdb-v2'
- name: Build and install rocksdb
run: |
HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install ccache
echo "/usr/local/opt/ccache/libexec" >> ${GITHUB_PATH}
curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus-build-system/master/scripts/build_rocksdb.sh
bash build_rocksdb.sh rocks-db-cache
- name: Get latest nimbus-build-system commit hash
id: versions
run: |
getHash() {
git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
}
nbsHash=$(getHash status-im/nimbus-build-system)
echo "nimbus_build_system=$nbsHash" >> $GITHUB_OUTPUT
- name: Restore prebuilt Nim from cache
uses: actions/cache@v4
with:
path: NimBinaries
key: 'nim-macos-amd64-${{ steps.versions.outputs.nimbus_build_system }}-sim'
- name: Build Nim and deps
run: |
ncpu=$(sysctl -n hw.ncpu)
make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
make -j${ncpu} deps
- name: Run Simulators
run: |
SIM_SCRIPT="hive_integration/nodocker/build_sims.sh"
chmod +x ${SIM_SCRIPT}
${SIM_SCRIPT} "MacOS-amd64"
- name: Upload artefact
uses: actions/upload-artifact@v4
with:
name: macos_amd64_stat
path: ./simulators.md
retention-days: 2
build-windows-amd64:
name: Windows-amd64
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Restore Nim DLLs dependencies from cache
id: windows-dlls-cache
uses: actions/cache@v4
with:
path: external/dlls
# according to docu, idle caches are kept for up to 7 days
# so change dlls# to force new cache contents (for some number #)
key: dlls0
- name: Install DLLs dependencies
if: steps.windows-dlls-cache.outputs.cache-hit != 'true'
run: |
ROCKSDBSUB=x64
DLLPATH=external/dlls
mkdir -p external
curl -L "https://nim-lang.org/download/windeps.zip" -o external/windeps.zip
7z x -y external/windeps.zip -o"$DLLPATH"
# ROCKSDB
curl -L "https://github.com/status-im/nimbus-deps/releases/download/nimbus-deps/nimbus-deps.zip" -o external/nimbus-deps.zip
7z x -y external/nimbus-deps.zip
cp "./$ROCKSDBSUB/librocksdb.dll" "$DLLPATH/librocksdb.dll"
- name: Restore llvm-mingw from cache
id: windows-mingw-cache
uses: actions/cache@v4
with:
path: external/mingw-amd64
key: 'mingw-llvm-17-sim'
- name: Install llvm-mingw dependency
if: steps.windows-mingw-cache.outputs.cache-hit != 'true'
run: |
mkdir -p external
MINGW_BASE="https://github.com/mstorsjo/llvm-mingw/releases/download/20230905"
MINGW_URL="$MINGW_BASE/llvm-mingw-20230905-ucrt-x86_64.zip"
curl -L "$MINGW_URL" -o "external/mingw-amd64.zip"
7z x -y "external/mingw-amd64.zip" -oexternal/mingw-amd64/
mv external/mingw-amd64/**/* ./external/mingw-amd64
- name: Path to cached dependencies
run: |
echo '${{ github.workspace }}'"/external/mingw-amd64/bin" >> $GITHUB_PATH
echo '${{ github.workspace }}'"/external/dlls" >> $GITHUB_PATH
- name: Get latest nimbus-build-system commit hash
id: versions
run: |
getHash() {
git ls-remote "https://github.com/$1" "${2:-HEAD}" | cut -f 1
}
nbsHash=$(getHash status-im/nimbus-build-system)
echo "nimbus_build_system=$nbsHash" >> $GITHUB_OUTPUT
- name: Restore prebuilt Nim from cache
uses: actions/cache@v4
with:
path: NimBinaries
key: 'nim-windows-amd64-${{ steps.versions.outputs.nimbus_build_system }}-sim'
- name: Build Nim and deps
run: |
ncpu=${NUMBER_OF_PROCESSORS}
mingw32-make -j${ncpu} ARCH_OVERRIDE=x64 CI_CACHE=NimBinaries update-from-ci
mingw32-make -j${ncpu} deps
- name: Run Simulators
run: |
SIM_SCRIPT="hive_integration/nodocker/build_sims.sh"
${SIM_SCRIPT} "Windows-amd64"
- name: Upload artefact
uses: actions/upload-artifact@v4
with:
name: windows_amd64_stat
path: ./simulators.md
retention-days: 2
prepare-stat:
name: Test results
needs: [build-linux-amd64, build-macos-amd64, build-windows-amd64]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: master
- name: Download artefacts
uses: actions/download-artifact@v4
- name: Create statistics notes
run: |
cat linux_amd64_stat/* > stat_notes.md
cat macos_amd64_stat/* >> stat_notes.md
cat windows_amd64_stat/* >> stat_notes.md
- name: Delete tag
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: sim-stat
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Simulators results
uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: true
commit: master
name: "Simulators results"
tag: sim-stat
bodyFile: "stat_notes.md"
- name: Delete artefacts
uses: geekyeggo/delete-artifact@v2
with:
failOnError: false
name: |
linux_amd64_stat
macos_amd64_stat
windows_amd64_stat