Skip to content

Commit 5f04a09

Browse files
committed
ci: add arm emulator build in github actions
1 parent 7307c47 commit 5f04a09

File tree

2 files changed

+74
-4
lines changed

2 files changed

+74
-4
lines changed

.github/workflows/core.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,44 @@ jobs:
126126
core/build/bootloader_emu/bootloader.elf
127127
retention-days: 7
128128

129+
core_emu_arm:
130+
if: github.event_name == 'schedule'
131+
name: Build emu arm
132+
runs-on: ubuntu-latest-arm64
133+
needs: param
134+
strategy:
135+
fail-fast: false
136+
matrix:
137+
model: [T2T1, T2B1, T3T1]
138+
coins: [universal]
139+
type: [debuglink]
140+
asan: [noasan]
141+
exclude:
142+
- type: normal
143+
asan: asan
144+
env:
145+
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'T2B1' && 'R' || matrix.model }}
146+
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
147+
PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }}
148+
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
149+
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
150+
steps:
151+
- uses: actions/checkout@v4
152+
with:
153+
submodules: recursive
154+
- uses: ./.github/actions/environment
155+
- run: nix-shell --run "poetry run make -C core build_bootloader_emu"
156+
if: matrix.coins == 'universal'
157+
- run: nix-shell --run "poetry run make -C core build_unix_frozen"
158+
- run: mv core/build/unix/trezor-emu-core core/build/unix/trezor-emu-arm-core-${{ matrix.model }}-${{ matrix.coins }}
159+
- uses: actions/upload-artifact@v4
160+
with:
161+
name: core-emu-arm-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}
162+
path: |
163+
core/build/unix/trezor-emu-*
164+
core/build/bootloader_emu/bootloader.elf
165+
retention-days: 2
166+
129167
core_unit_python_test:
130168
name: Python unit tests
131169
runs-on: ubuntu-latest
@@ -708,7 +746,9 @@ jobs:
708746
name: Upload emulator binaries
709747
if: github.event_name == 'schedule'
710748
runs-on: ubuntu-latest
711-
needs: core_emu
749+
needs:
750+
- core_emu
751+
- core_emu_arm
712752
steps:
713753
- uses: actions/download-artifact@v4
714754
with:

.github/workflows/legacy.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,34 @@ jobs:
7474
legacy/firmware/trezor-emu-legacy*
7575
retention-days: 7
7676

77+
legacy_emu_arm:
78+
if: github.event_name == 'schedule'
79+
name: Emulator arm
80+
runs-on: ubuntu-latest-arm64
81+
strategy:
82+
matrix:
83+
coins: [universal]
84+
type: [debuglink]
85+
asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }}
86+
env:
87+
EMULATOR: 1
88+
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
89+
DEBUG_LINK: ${{ matrix.type == 'debuglink' && '1' || '0' }}
90+
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
91+
steps:
92+
- uses: actions/checkout@v4
93+
with:
94+
submodules: recursive
95+
- uses: ./.github/actions/environment
96+
- run: nix-shell --run "poetry run legacy/script/cibuild"
97+
- run: mv legacy/firmware/trezor.elf legacy/firmware/trezor-emu-arm-legacy-T1B1-${{ matrix.coins }}
98+
- uses: actions/upload-artifact@v4
99+
with:
100+
name: legacy-emu-arm-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}
101+
path: |
102+
legacy/firmware/trezor-emu-arm-legacy*
103+
retention-days: 7
104+
77105
legacy_device_test:
78106
name: Device test
79107
runs-on: ubuntu-latest
@@ -202,11 +230,13 @@ jobs:
202230
# TODO: always run if comment already exists
203231
if: ${{ steps.check-fixtures-changed.outputs.FIXTURES_CHANGED == '1' }}
204232

205-
core_upload_emu:
233+
legacy_upload_emu:
206234
name: Upload emulator binaries
207235
if: github.event_name == 'schedule'
208236
runs-on: ubuntu-latest
209-
needs: legacy_emu
237+
needs:
238+
- legacy_emu
239+
- legacy_emu_arm
210240
steps:
211241
- uses: actions/download-artifact@v4
212242
with:
@@ -220,5 +250,5 @@ jobs:
220250
continue-on-error: true
221251
- run: |
222252
mkdir emulators
223-
cp trezor-emu-legacy* emulators
253+
cp trezor-emu-* emulators
224254
aws s3 sync --no-progress emulators s3://data.trezor.io/dev/firmware/emu-nightly

0 commit comments

Comments
 (0)