13
13
RUST_CACHE_DIRS : " ~/.cargo/registry\n ~/.cargo/git\n target\n "
14
14
LIBCLANG_PATH_WIN : " C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/Llvm/x64/bin"
15
15
CARGO_MAKE_VERSION : 0.35.0
16
- MINICONDA_VERSION : " py38_4.10.3"
17
16
CARGO_INCREMENTAL : 0
18
17
RUSTFLAGS : " -C debuginfo=0"
19
18
@@ -76,29 +75,23 @@ jobs:
76
75
toolchain : stable
77
76
78
77
- uses : Swatinem/rust-cache@v1
79
-
78
+
80
79
- uses : davidB/rust-cargo-make@v1
81
80
with :
82
81
version : ${{ env.CARGO_MAKE_VERSION }}
83
82
84
- - uses : conda-incubator/setup-miniconda@v2
85
- with :
86
- activate-environment : console_pp
87
- environment-file : conda.yml
88
- miniconda-version : ${{ env.MINICONDA_VERSION }}
89
-
90
83
- name : Cache pip
91
84
uses : actions/cache@v2
92
85
with :
93
86
path : ${{ env.PIP_CACHE_DIR }}
94
- key : ${{ runner.os }}-pip- ${{ hashFiles('requirements-dev.txt ') }}
87
+ key : ${{ runner.os }}-pyproject-toml- ${{ hashFiles('pyproject.toml ') }}
95
88
restore-keys : |
96
- ${{ runner.os }}-pip -
89
+ ${{ runner.os }}-pyproject-toml -
97
90
${{ runner.os }}-
98
91
99
- - name : Run Pip Install
92
+ - name : Set up python builder
100
93
run : |
101
- cargo make pip-install-dev
94
+ cargo make setup-builder
102
95
103
96
- name : Run Backend Benchmarks (Windows)
104
97
env :
@@ -153,26 +146,19 @@ jobs:
153
146
run : |
154
147
sudo apt-get update && sudo apt-get install -y capnproto libudev-dev
155
148
156
- - uses : conda-incubator/setup-miniconda@v2
157
- with :
158
- activate-environment : console_pp
159
- environment-file : conda.yml
160
- miniconda-version : ${{ env.MINICONDA_VERSION }}
161
-
162
- - name : Run Requirements Generation Check
163
- run : |
164
- cargo make poetry-export
165
- git diff --exit-code
166
-
167
149
- name : Cache pip
168
150
uses : actions/cache@v2
169
151
with :
170
152
path : ${{ env.PIP_CACHE_DIR }}
171
- key : ${{ runner.os }}-pip- ${{ hashFiles('requirements-dev.txt ') }}
153
+ key : ${{ runner.os }}-pyproject-toml- ${{ hashFiles('pyproject.toml ') }}
172
154
restore-keys : |
173
- ${{ runner.os }}-pip -
155
+ ${{ runner.os }}-pyproject-toml -
174
156
${{ runner.os }}-
175
157
158
+ - name : Set up python builder
159
+ run : |
160
+ cargo make setup-builder
161
+
176
162
- name : Run Checks
177
163
run : |
178
164
cargo make check-all
@@ -266,56 +252,53 @@ jobs:
266
252
with :
267
253
version : ${{ env.CARGO_MAKE_VERSION }}
268
254
269
- - uses : conda-incubator/setup-miniconda@v2
270
- with :
271
- activate-environment : console_pp
272
- environment-file : conda.yml
273
- miniconda-version : ${{ env.MINICONDA_VERSION }}
274
-
275
255
- name : Cache pip
276
256
uses : actions/cache@v2
277
257
with :
278
258
path : ${{ env.PIP_CACHE_DIR }}
279
- key : ${{ runner.os }}-pip- ${{ hashFiles('requirements-dev.txt ') }}
259
+ key : ${{ runner.os }}-pyproject-toml- ${{ hashFiles('pyproject.toml ') }}
280
260
restore-keys : |
281
- ${{ runner.os }}-pip -
261
+ ${{ runner.os }}-pyproject-toml -
282
262
${{ runner.os }}-
283
263
284
- - name : Run Pip Install
264
+ - name : Set up python builder
285
265
run : |
286
- cargo make pip-install-dev
266
+ cargo make setup-builder
287
267
288
268
- name : Build ${{ runner.os }} Binaries.
289
269
env :
290
270
LIBCLANG_PATH : ${{ env.LIBCLANG_PATH_WIN }}
291
271
run : |
292
- cargo make prod-installer
272
+ cargo make create-dist
293
273
if : matrix.os == 'windows-2019'
294
274
295
275
- name : Build ${{ runner.os }} Binaries.
296
276
shell : bash
297
277
run : |
298
- cargo make prod-installer
278
+ cargo make create-dist
299
279
if : matrix.os != 'windows-2019'
300
280
301
281
- name : Pull Git LFS objects
302
282
run : git lfs pull
303
283
env :
304
284
GIT_SSH_COMMAND : ssh -o StrictHostKeyChecking=no
305
- - name : Zip ${{ runner.os }} Binaries.
285
+ - name : Archive ${{ runner.os }} Binaries.
306
286
env :
307
287
OS_NAME : ${{ runner.os }}
308
288
shell : bash
309
289
run : |
310
- bash ./.github/ci-build.sh
290
+ mkdir bench
291
+ cp -r console_backend/tests/data bench
292
+ cp utils/bench_runner.py bench
293
+ cd bench
294
+ 7z a -tzip "../$OS_NAME.zip" *;
295
+ cd ..
296
+ echo "${OS_NAME}.zip" >bench-archive.filename;
297
+ echo "BENCH_ARCHIVE=$(cat bench-archive.filename)" >>$GITHUB_ENV
298
+
299
+ RELEASE_ARCHIVE=$(find . -maxdepth 1 -iname "*.tar.xz")
300
+ echo $RELEASE_ARCHIVE >release-archive.filename
311
301
echo "RELEASE_ARCHIVE=$(cat release-archive.filename)" >>$GITHUB_ENV
312
- echo "BENCH_ARCHIVE=$(cat bench.filename)" >>$GITHUB_ENV
313
- - name : ${{ runner.os }} Installer Size Benchmark.
314
- env :
315
- OS_NAME : ${{ runner.os }}
316
- shell : bash
317
- run : |
318
- cargo make disk-usage-bench
319
302
- uses : actions/upload-artifact@v2
320
303
with :
321
304
name : ${{ runner.os }}-artifacts
@@ -327,7 +310,13 @@ jobs:
327
310
name : ${{ runner.os }}-artifacts-bench
328
311
path : |
329
312
${{ env.BENCH_ARCHIVE }}
330
- bench.filename
313
+ bench-archive.filename
314
+ - name : ${{ runner.os }} Installer Size Benchmark.
315
+ env :
316
+ OS_NAME : ${{ runner.os }}
317
+ shell : bash
318
+ run : |
319
+ cargo make disk-usage-bench
331
320
frontend_bench :
332
321
name : Run Frontend Benchmarks
333
322
timeout-minutes : 30
@@ -344,38 +333,62 @@ jobs:
344
333
- name : Remove previous build.
345
334
shell : bash
346
335
run : |
347
- rm -rf output
336
+ rm -rf console
337
+ rm -rf bench
338
+
339
+ - uses : actions/download-artifact@v2
340
+ with :
341
+ name : ${{ matrix.os }}-artifacts
342
+ path : |
343
+ console
344
+
348
345
- uses : actions/download-artifact@v2
349
346
with :
350
347
name : ${{ matrix.os }}-artifacts-bench
351
348
path : |
352
- output
349
+ bench
350
+
353
351
- name : Extract binary and data.
352
+ shell : bash
354
353
run : |
355
- cd output
356
- 7z x $(cat bench.filename) -aoa -o${{ matrix.os }}
354
+ cd console
355
+ archive=$(cat release-archive.filename)
356
+ 7z x $archive -aoa
357
+ 7z x ${archive%.xz} -aoa
358
+ echo "extracted release-archive"
359
+ mv ../bench/${{ matrix.os }}.zip .
360
+ 7z x ${{ matrix.os }}.zip -aoa
361
+ echo "extracted bench data"
357
362
358
363
- name : Run CPU Frontend Benchmark.
359
364
shell : bash
360
365
run : |
361
- cd output/${{ matrix.os }}
366
+ cd console
362
367
if [ "$RUNNER_OS" == "Windows" ]; then
363
- python bench_runner.py --frontend_cpu --executable=swift_navigation_console .exe
368
+ python ./ bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/console/Scripts/swiftnav-console .exe"
364
369
elif [ "$RUNNER_OS" == "macOS" ]; then
365
- python bench_runner.py --frontend_cpu --executable=./main
370
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
371
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
372
+ python ./bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
366
373
elif [ "$RUNNER_OS" == "Linux" ]; then
367
- python bench_runner.py --frontend_cpu --executable=./swift_navigation_console
374
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
375
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
376
+ python ./bench_runner.py --frontend_cpu --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
368
377
fi
369
378
- name : Run MEM Frontend Benchmark.
370
379
shell : bash
371
380
run : |
372
- cd output/${{ matrix.os }}
381
+ cd console
373
382
if [ "$RUNNER_OS" == "Windows" ]; then
374
- python bench_runner.py --frontend_mem --executable=swift_navigation_console .exe
383
+ python ./ bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/console/Scripts/swiftnav-console .exe"
375
384
elif [ "$RUNNER_OS" == "macOS" ]; then
376
- python bench_runner.py --frontend_mem --executable=./main
385
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
386
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
387
+ python ./bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
377
388
elif [ "$RUNNER_OS" == "Linux" ]; then
378
- python bench_runner.py --frontend_mem --executable=./swift_navigation_console
389
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
390
+ chmod +x "${GITHUB_WORKSPACE}/console/bin/python3"
391
+ python ./bench_runner.py --frontend_mem --executable="${GITHUB_WORKSPACE}/console/bin/swiftnav-console"
379
392
fi
380
393
381
394
0 commit comments