-
-
Notifications
You must be signed in to change notification settings - Fork 773
226 lines (213 loc) · 8.91 KB
/
legacy.yml
File metadata and controls
226 lines (213 loc) · 8.91 KB
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
name: Legacy
on:
pull_request:
workflow_dispatch:
schedule:
- cron: '35 22 * * *' # every day @ 22:35
push:
branches:
- 'release/**'
- 'secfix/**'
# cancel any previous runs on the same PR
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
id-token: write # for fetching the OIDC token
contents: read # for actions/checkout
pull-requests: write # For dflook comments on PR
env:
SDL_VIDEODRIVER: dummy
# See https://yaml-multiline.info/
PULL_COMMENT: >
|legacy UI changes|device test|
|-----------------|-----------|
|T1B1 Model 1
|<img src="https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T1B1-en-legacy_device_test-status.png" width="20px" height="20px" />
[test](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T1B1-en-legacy_device_test-index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T1B1-en-legacy_device_test-differing_screens.html))
[main](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T1B1-en-legacy_device_test-master_index.html)([screens](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/T1B1-en-legacy_device_test-master_diff.html))
|
jobs:
legacy_firmware:
name: Firmware
runs-on: ubuntu-latest
strategy:
matrix:
coins: [universal, btconly]
type: [normal, debuglink]
env:
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
DEBUG_LINK: ${{ matrix.type == 'debuglink' && '1' || '0' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --run "export PRODUCTION=1 && uv run legacy/script/cibuild"
- run: nix-shell --run "uv run legacy/script/setup"
- run: nix-shell --run "export PRODUCTION=0 && uv run legacy/script/cibuild"
- run: nix-shell --run "uv run make -C legacy/demo"
if: matrix.coins == 'universal' && matrix.type == 'normal'
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # actions/upload-artifact@v7.0.0
with:
name: legacy-firmware-${{ matrix.coins }}-${{ matrix.type }}
path: legacy/firmware/firmware-*.bin
retention-days: 7
legacy_emu:
name: Emulator
runs-on: ubuntu-latest
strategy:
matrix:
coins: [universal, btconly]
# type: [normal, debuglink]
type: [debuglink]
arch: [x86_64]
asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }}
env:
EMULATOR: 1
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
DEBUG_LINK: ${{ matrix.type == 'debuglink' && '1' || '0' }}
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --run "uv run legacy/script/cibuild"
- run: cp legacy/firmware/trezor.elf legacy/firmware/trezor-emu-legacy-T1B1-${{ matrix.coins }}
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # actions/upload-artifact@v7.0.0
with:
name: legacy-emu-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}
path: |
legacy/firmware/*.elf
legacy/firmware/trezor-emu-legacy*
retention-days: 7
legacy_emu_arm:
if: github.event_name == 'schedule'
name: Emulator arm
runs-on: ubuntu-latest-arm64
strategy:
matrix:
coins: [universal]
type: [debuglink]
asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }}
env:
EMULATOR: 1
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
DEBUG_LINK: ${{ matrix.type == 'debuglink' && '1' || '0' }}
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --run "uv run legacy/script/cibuild"
- run: mv legacy/firmware/trezor.elf legacy/firmware/trezor-emu-arm-legacy-T1B1-${{ matrix.coins }}
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # actions/upload-artifact@v7.0.0
with:
name: legacy-emu-arm-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}
path: |
legacy/firmware/trezor-emu-arm-legacy*
retention-days: 7
legacy_device_test:
name: Device test
runs-on: ubuntu-latest
needs: legacy_emu
timeout-minutes: 20
strategy:
matrix:
coins: [universal, btconly]
asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }}
env:
EMULATOR: 1
PYTEST_TIMEOUT: 120
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
submodules: recursive
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
with:
name: legacy-emu-${{ matrix.coins }}-debuglink-${{ matrix.asan }}
path: legacy/firmware
- run: chmod +x legacy/firmware/*.elf
- uses: ./.github/actions/environment
- run: nix-shell --run "uv run make -C legacy test_emu_ui"
if: matrix.coins == 'universal'
- run: nix-shell --run "uv run make -C legacy test_emu"
if: matrix.coins != 'universal'
- uses: ./.github/actions/ui-report
with:
model: T1B1
lang: en
status: ${{ job.status }}
continue-on-error: true
if: ${{ always() && matrix.coins == 'universal' }}
- run: echo "${{ env.PULL_COMMENT }}" >> $GITHUB_STEP_SUMMARY
if: ${{ always() && matrix.coins == 'universal' }}
legacy_upgrade_test:
name: Upgrade test
runs-on: ubuntu-latest
needs: legacy_emu
timeout-minutes: 10
strategy:
matrix:
asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }}
env:
TREZOR_UPGRADE_TEST: T1B1
PYTEST_TIMEOUT: 120
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
submodules: recursive
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
with:
name: legacy-emu-universal-debuglink-${{ matrix.asan }}
path: legacy/firmware
- run: chmod +x legacy/firmware/*.elf
- uses: ./.github/actions/environment
- run: nix-shell --run "tests/download_emulators.sh T1B1"
- run: nix-shell --run "uv run pytest tests/upgrade_tests"
legacy_hwi_test:
name: HWI test
if: false # XXX currently failing
continue-on-error: true
runs-on: ubuntu-latest
needs: legacy_emu
env:
EMULATOR: 1
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
submodules: recursive
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
with:
name: legacy-emu-universal-debuglink-noasan
path: legacy/firmware
- run: chmod +x legacy/firmware/*.elf
- uses: ./.github/actions/environment
with:
full-deps: "true"
- run: nix-shell --run "git clone --depth=1 https://github.com/bitcoin-core/HWI.git"
- run: nix-shell --arg fullDeps true --run "cd HWI && poetry install && poetry run ./test/test_trezor.py --model_1 ../legacy/firmware/trezor.elf bitcoind"
legacy_upload_emu:
name: Upload emulator binaries
if: github.event_name == 'schedule' && github.repository == 'trezor/trezor-firmware'
runs-on: ubuntu-latest
needs:
- legacy_emu
- legacy_emu_arm
steps:
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
with:
pattern: legacy-emu*debuglink-noasan
merge-multiple: true
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # aws-actions/configure-aws-credentials@v6.0.0
with:
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_deploy_dev_firmware_data
aws-region: eu-west-1
continue-on-error: true
- run: |
mkdir emulators
cp trezor-emu-* emulators
aws s3 sync --only-show-errors emulators s3://data.trezor.io/dev/firmware/emu-nightly