Skip to content

Commit 3815549

Browse files
committed
wip workflows
1 parent e7747fa commit 3815549

1 file changed

Lines changed: 48 additions & 49 deletions

File tree

.github/workflows/core.yml

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,20 @@ jobs:
9494
- run: nix-shell --run "uv run make -C core build_prodtest_emu"
9595
if: matrix.coins == 'universal' && matrix.type != 'debuglink' && matrix.model == 'T3W1'
9696
- run: nix-shell --run "uv run make -C core build_firmware"
97-
- run: nix-shell --run "uv run ./tools/print-rust-stack-sizes.py | sort -k1 -n | tail -n 50"
98-
- run: nix-shell --run "uv run ./tools/print-rust-type-sizes.sh core/build/firmware/rust-type-sizes.log" | awk '$1 >= 1000' | sort -k1 -n
99-
- run: nix-shell --run "uv run make -C core sizecheck"
100-
if: matrix.coins == 'universal' && matrix.type != 'debuglink'
101-
- run: nix-shell --run "uv run ./tools/check-bitcoin-only core/build/firmware/firmware.bin"
97+
# -Z emit-stack-sizes does not work under xtask for some reason
98+
# - run: nix-shell --run "uv run ./tools/print-rust-stack-sizes.py | sort -k1 -n | tail -n 50"
99+
# - run: nix-shell --run "uv run ./tools/print-rust-type-sizes.sh core/build/firmware/rust-type-sizes.log" | awk '$1 >= 1000' | sort -k1 -n
100+
# - run: nix-shell --run "uv run make -C core sizecheck"
101+
# if: matrix.coins == 'universal' && matrix.type != 'debuglink'
102+
- run: nix-shell --run "uv run ./tools/check-bitcoin-only core/build-xtask/artifacts/latest/firmware.bin"
102103
if: matrix.coins == 'btconly' && matrix.type != 'debuglink'
103104
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # actions/upload-artifact@v7.0.0
104105
with:
105106
name: core-firmware-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}${{ matrix.n4w1 && '-n4w1' || '' }}
106107
path: |
107-
core/build/boardloader/*.bin
108-
core/build/bootloader/*.bin
109-
core/build/bootloader_ci/*.bin
110-
core/build/prodtest/*.bin
111-
core/build/prodtest_emu/*.bin
112-
core/build/firmware/firmware.elf
113-
core/build/firmware/firmware-*.bin
114-
core/build/firmware/rust-type-sizes.log
108+
core/build-xtask/artifacts/latest/*.bin
109+
core/build-xtask/artifacts/latest/*.elf
110+
core/build-xtask/artifacts/pub/*
115111
retention-days: 7
116112

117113
core_emu:
@@ -157,15 +153,15 @@ jobs:
157153
if: ${{ matrix.model == 'T3W1' }}
158154
run: nix-shell --run "uv run model_server tcp -c tests/tropic_model/config.yml > tests/trezor-tropic-model.log 2>&1 &"
159155
- run: nix-shell --run "uv run make -C core test_emu_sanity"
160-
- run: cp core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-${{ matrix.model }}-${{ matrix.coins }}${{ matrix.n4w1 && '-n4w1' || '' }}
156+
- run: cp core/build-xtask/artifacts/latest/firmware-emu core/build-xtask/artifacts/latest/firmware-emu-${{ matrix.model }}-${{ matrix.coins }}${{ matrix.n4w1 && '-n4w1' || '' }}
161157
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # actions/upload-artifact@v7.0.0
162158
with:
163159
name: core-emu-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}${{ matrix.n4w1 && '-n4w1' || '' }}
164160
path: |
165-
core/build/unix/trezor-emu-core*
166-
core/build/bootloader_emu/bootloader.elf
167-
core/build/unix/src/**/*.i
161+
core/build-xtask/artifacts/latest/firmware-emu*
162+
core/build-xtask/artifacts/latest/bootloader-emu
168163
retention-days: 7
164+
# FIXME: core/build/unix/src/**/*.i
169165

170166
core_emu_arm:
171167
if: github.event_name == 'schedule'
@@ -202,13 +198,13 @@ jobs:
202198
- run: nix-shell --run "uv run make -C core build_bootloader_emu"
203199
if: matrix.coins == 'universal'
204200
- run: nix-shell --run "uv run make -C core build_unix_frozen"
205-
- run: mv core/build/unix/trezor-emu-core core/build/unix/trezor-emu-arm-core-${{ matrix.model }}-${{ matrix.coins }}${{ matrix.n4w1 && '-n4w1' || '' }}
201+
- run: mv core/build-xtask/artifacts/latest/firmware-emu core/build-xtask/artifacts/latest/firmware-emu-arm-${{ matrix.model }}-${{ matrix.coins }}${{ matrix.n4w1 && '-n4w1' || '' }}
206202
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # actions/upload-artifact@v7.0.0
207203
with:
208204
name: core-emu-arm-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}${{ matrix.n4w1 && '-n4w1' || '' }}
209205
path: |
210-
core/build/unix/trezor-emu-*
211-
core/build/bootloader_emu/bootloader.elf
206+
core/build-xtask/artifacts/latest/firmware-emu*
207+
core/build-xtask/artifacts/latest/bootloader-emu
212208
retention-days: 2
213209

214210
core_unit_python_test:
@@ -265,7 +261,8 @@ jobs:
265261
# This makes sure that rust-analyzer will work on our codebase.
266262
- run: nix-shell --run "cd core/embed/rust && cargo build"
267263
if: matrix.asan == 'noasan'
268-
- run: nix-shell --run "uv run make -C core clippy"
264+
# FIXME
265+
# - run: nix-shell --run "uv run make -C core clippy"
269266
- run: nix-shell --run "uv run make -C core test_rust"
270267
- run: nix-shell --run "uv run make -C core audit_rust"
271268

@@ -284,8 +281,8 @@ jobs:
284281
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
285282
with:
286283
name: core-emu-${{ matrix.model }}-universal-debuglink-noasan
287-
path: core/build
288-
- run: chmod +x core/build/unix/trezor-emu-core*
284+
path: core/build-xtask/artifacts/latest
285+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
289286
- uses: ./.github/actions/environment
290287
- run: nix-shell --run "uv run core/emu.py --headless -q --temporary-profile --slip0014 --command cargo test --manifest-path rust/trezor-client/Cargo.toml"
291288

@@ -329,8 +326,8 @@ jobs:
329326
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
330327
with:
331328
name: core-emu-${{ matrix.model }}-${{ matrix.coins }}-debuglink-${{ matrix.asan }}${{ matrix.n4w1 && '-n4w1' || '' }}
332-
path: core/build
333-
- run: chmod +x core/build/unix/trezor-emu-core*
329+
path: core/build-xtask/artifacts/latest
330+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
334331
- uses: ./.github/actions/environment
335332
- name: Start Tropic model
336333
if: ${{ env.TREZOR_MODEL == 'T3W1' && env.ACTIONS_DO_UI_TEST != 'true' }} # ACTIONS_DO_UI_TEST refers to the test_emu_ui_multicore below which uses --control-emulators and starts tvl internally
@@ -387,8 +384,8 @@ jobs:
387384
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
388385
with:
389386
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
390-
path: core/build
391-
- run: chmod +x core/build/unix/trezor-emu-core*
387+
path: core/build-xtask/artifacts/latest
388+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
392389
- uses: ./.github/actions/environment
393390
- run: nix-shell --run "uv run make -C core test_emu_click_ui_multicore"
394391
if: ${{ matrix.asan == 'noasan' }}
@@ -437,8 +434,8 @@ jobs:
437434
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
438435
with:
439436
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
440-
path: core/build
441-
- run: chmod +x core/build/unix/trezor-emu-core*
437+
path: core/build-xtask/artifacts/latest
438+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
442439
- uses: ./.github/actions/environment
443440
with:
444441
full-deps: "true"
@@ -478,8 +475,8 @@ jobs:
478475
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
479476
with:
480477
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
481-
path: core/build
482-
- run: chmod +x core/build/unix/trezor-emu-core*
478+
path: core/build-xtask/artifacts/latest
479+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
483480
- uses: ./.github/actions/environment
484481
- name: Start Tropic model
485482
if: ${{ matrix.model == 'T3W1' }}
@@ -521,13 +518,13 @@ jobs:
521518
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
522519
with:
523520
name: core-emu-${{ matrix.model }}-universal-debuglink-noasan
524-
path: core/build
525-
- run: chmod +x core/build/unix/trezor-emu-core*
521+
path: core/build-xtask/artifacts/latest
522+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
526523
- uses: ./.github/actions/environment
527524
with:
528525
full-deps: "true"
529526
- run: nix-shell --run "git clone --depth=1 https://github.com/bitcoin-core/HWI.git"
530-
- run: nix-shell --arg fullDeps true --run "cd HWI && poetry install && poetry run ./test/test_trezor.py --model_t ../core/build/unix/trezor-emu-core bitcoind"
527+
- run: nix-shell --arg fullDeps true --run "cd HWI && poetry install && poetry run ./test/test_trezor.py --model_t ../core/build-xtask/artifacts/latest/firmware-emu bitcoind"
531528
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # actions/upload-artifact@v7.0.0
532529
with:
533530
name: core-test-hwi-${{ matrix.model }}
@@ -580,9 +577,9 @@ jobs:
580577
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
581578
with:
582579
name: core-firmware-${{ matrix.model }}-universal-normal # FIXME: s/normal/debuglink/
583-
path: core/build
580+
path: core/build-xtask
584581
- uses: ./.github/actions/environment
585-
- run: nix-shell --run "uv run core/tools/size/checker.py core/build/firmware/firmware.elf"
582+
- run: nix-shell --run "uv run core/tools/size/checker.py core/build-xtask/artifacts/latest/firmware.elf"
586583

587584
# Monero tests.
588585
core_monero_test:
@@ -606,8 +603,8 @@ jobs:
606603
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
607604
with:
608605
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
609-
path: core/build
610-
- run: chmod +x core/build/unix/trezor-emu-core*
606+
path: core/build-xtask/artifacts/latest
607+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
611608
- uses: ./.github/actions/environment
612609
with:
613610
full-deps: "true"
@@ -625,7 +622,7 @@ jobs:
625622

626623
# Tests for U2F and HID.
627624
core_u2f_test:
628-
name: U2F test (${{ matrix.model }}, ${{ matrix.asan }}
625+
name: U2F test (${{ matrix.model }}, ${{ matrix.asan }})
629626
runs-on: ubuntu-latest
630627
needs:
631628
- param
@@ -645,8 +642,8 @@ jobs:
645642
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
646643
with:
647644
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
648-
path: core/build
649-
- run: chmod +x core/build/unix/trezor-emu-core*
645+
path: core/build-xtask/artifacts/latest
646+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
650647
- uses: ./.github/actions/environment
651648
- name: Start Tropic model
652649
if: ${{ matrix.model == 'T3W1' }}
@@ -663,7 +660,7 @@ jobs:
663660

664661
# FIDO2 device tests.
665662
core_fido2_test:
666-
name: FIDO2 test (${{ matrix.model }}, ${{ matrix.asan }}
663+
name: FIDO2 test (${{ matrix.model }}, ${{ matrix.asan }})
667664
runs-on: ubuntu-latest
668665
needs:
669666
- param
@@ -683,8 +680,8 @@ jobs:
683680
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
684681
with:
685682
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
686-
path: core/build
687-
- run: chmod +x core/build/unix/trezor-emu-core*
683+
path: core/build-xtask/artifacts/latest
684+
- run: chmod +x core/build-xtask/artifacts/latest/firmware-emu*
688685
- uses: ./.github/actions/environment
689686
- name: Start Tropic model
690687
if: ${{ matrix.model == 'T3W1' }}
@@ -731,7 +728,7 @@ jobs:
731728
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
732729
with:
733730
name: core-emu-${{ matrix.model }}-universal-debuglink-noasan
734-
path: core/build
731+
path: core/build-xtask
735732
- uses: ./.github/actions/environment
736733
# `make coverage` uses .i files downloaded above
737734
- run: nix-shell --run "uv run make -C core coverage"
@@ -812,9 +809,10 @@ jobs:
812809
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_deploy_dev_firmware_data
813810
aws-region: eu-west-1
814811
continue-on-error: true
812+
# FIXME
815813
- run: |
816-
rm unix/trezor-emu-core
817-
aws s3 sync --only-show-errors unix s3://data.trezor.io/dev/firmware/emu-nightly
814+
rm firmware-emu
815+
#aws s3 sync --only-show-errors firmware-emu-* s3://data.trezor.io/dev/firmware/emu-nightly
818816
819817
core_upload_emu_branch:
820818
name: Upload emulator binaries for the current branch
@@ -843,10 +841,11 @@ jobs:
843841
branch_name=${{ github.ref_name }}
844842
fi
845843
echo "branch_name=$branch_name" >> $GITHUB_ENV
844+
# FIXME
846845
- name: Upload artifacts to branch directory
847846
run: |
848-
rm unix/trezor-emu-core
849-
aws s3 sync --only-show-errors unix s3://data.trezor.io/dev/firmware/emu-branches/$branch_name
847+
rm firmware-emu
848+
#aws s3 sync --only-show-errors firmware-emu-* s3://data.trezor.io/dev/firmware/emu-branches/$branch_name
850849
851850
# Connect
852851
# TODO: core_connect_test

0 commit comments

Comments
 (0)