mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-04 13:38:28 +00:00
build(ci): add (a few) THP builds and tests into core workflow
[no changelog]
This commit is contained in:
parent
e823791b88
commit
e50521fc54
73
.github/workflows/core.yml
vendored
73
.github/workflows/core.yml
vendored
@ -54,10 +54,19 @@ jobs:
|
|||||||
model: [T2T1, T3B1, T3T1, T3W1]
|
model: [T2T1, T3B1, T3T1, T3W1]
|
||||||
coins: [universal, btconly]
|
coins: [universal, btconly]
|
||||||
type: ${{ fromJSON(github.event_name == 'schedule' && '["normal", "debuglink", "production"]' || '["normal", "debuglink"]') }}
|
type: ${{ fromJSON(github.event_name == 'schedule' && '["normal", "debuglink", "production"]' || '["normal", "debuglink"]') }}
|
||||||
|
protocol: [v1]
|
||||||
include:
|
include:
|
||||||
- model: D001
|
- model: D001
|
||||||
coins: universal
|
coins: universal
|
||||||
type: normal
|
type: normal
|
||||||
|
- model: T2T1
|
||||||
|
coins: universal
|
||||||
|
type: debuglink
|
||||||
|
protocol: v2
|
||||||
|
- model: T2T1
|
||||||
|
coins: btconly
|
||||||
|
type: debuglink
|
||||||
|
protocol: v2
|
||||||
exclude:
|
exclude:
|
||||||
- model: T3W1
|
- model: T3W1
|
||||||
type: production
|
type: production
|
||||||
@ -67,6 +76,7 @@ jobs:
|
|||||||
PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }}
|
PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }}
|
||||||
PRODUCTION: ${{ matrix.type == 'production' && '1' || '0' }}
|
PRODUCTION: ${{ matrix.type == 'production' && '1' || '0' }}
|
||||||
BOOTLOADER_DEVEL: ${{ matrix.model == 'T3W1' && '1' || '0' }}
|
BOOTLOADER_DEVEL: ${{ matrix.model == 'T3W1' && '1' || '0' }}
|
||||||
|
THP: ${{ matrix.protocol == 'v2' && '1' || '0'}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -87,7 +97,7 @@ jobs:
|
|||||||
if: matrix.coins == 'btconly' && matrix.type != 'debuglink'
|
if: matrix.coins == 'btconly' && matrix.type != 'debuglink'
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-firmware-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}
|
name: core-firmware-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-protocol_${{ matrix.protocol }}
|
||||||
path: |
|
path: |
|
||||||
core/build/boardloader/*.bin
|
core/build/boardloader/*.bin
|
||||||
core/build/bootloader/*.bin
|
core/build/bootloader/*.bin
|
||||||
@ -109,15 +119,28 @@ jobs:
|
|||||||
# type: [normal, debuglink]
|
# type: [normal, debuglink]
|
||||||
type: [debuglink]
|
type: [debuglink]
|
||||||
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
||||||
|
protocol: [v1]
|
||||||
exclude:
|
exclude:
|
||||||
- type: normal
|
- type: normal
|
||||||
asan: asan
|
asan: asan
|
||||||
|
include:
|
||||||
|
- model: T2T1
|
||||||
|
coins: universal
|
||||||
|
type: debuglink
|
||||||
|
asan: noasan
|
||||||
|
protocol: v2
|
||||||
|
- model: T2T1
|
||||||
|
coins: btconly
|
||||||
|
type: debuglink
|
||||||
|
asan: noasan
|
||||||
|
protocol: v2
|
||||||
env:
|
env:
|
||||||
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
||||||
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
|
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
|
||||||
PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }}
|
PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }}
|
||||||
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
||||||
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
|
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
|
||||||
|
THP: ${{ matrix.protocol == 'v2' && '1' || '0'}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -129,7 +152,7 @@ jobs:
|
|||||||
- run: cp core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-${{ matrix.model }}-${{ matrix.coins }}
|
- run: cp core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-${{ matrix.model }}-${{ matrix.coins }}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}-protocol_${{ matrix.protocol }}
|
||||||
path: |
|
path: |
|
||||||
core/build/unix/trezor-emu-core*
|
core/build/unix/trezor-emu-core*
|
||||||
core/build/bootloader_emu/bootloader.elf
|
core/build/bootloader_emu/bootloader.elf
|
||||||
@ -174,7 +197,7 @@ jobs:
|
|||||||
retention-days: 2
|
retention-days: 2
|
||||||
|
|
||||||
core_unit_python_test:
|
core_unit_python_test:
|
||||||
name: Python unit tests
|
name: Python unit tests (${{ matrix.model }}, ${{ matrix.asan }}, protocol_${{ matrix.protocol}})
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: param
|
needs: param
|
||||||
strategy:
|
strategy:
|
||||||
@ -182,10 +205,12 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
model: [T2T1, T3B1, T3T1, T3W1]
|
model: [T2T1, T3B1, T3T1, T3W1]
|
||||||
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
||||||
|
protocol: [v1, v2]
|
||||||
env:
|
env:
|
||||||
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
||||||
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
||||||
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
|
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
|
||||||
|
THP: ${{ matrix.protocol == 'v2' && '1' || '0'}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -195,7 +220,7 @@ jobs:
|
|||||||
- run: nix-shell --run "poetry run make -C core test"
|
- run: nix-shell --run "poetry run make -C core test"
|
||||||
|
|
||||||
core_unit_rust_test:
|
core_unit_rust_test:
|
||||||
name: Rust unit tests
|
name: Rust unit tests (${{ matrix.model }}, ${{ matrix.asan }}, protocol_${{ matrix.protocol}})
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- param
|
- param
|
||||||
@ -205,12 +230,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
model: [T2T1, T3B1, T3T1, T3W1]
|
model: [T2T1, T3B1, T3T1, T3W1]
|
||||||
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
||||||
|
protocol: [v1, v2]
|
||||||
env:
|
env:
|
||||||
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
||||||
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
||||||
RUSTC_BOOTSTRAP: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
RUSTC_BOOTSTRAP: ${{ matrix.asan == 'asan' && '1' || '0' }}
|
||||||
RUSTFLAGS: ${{ matrix.asan == 'asan' && '-Z sanitizer=address' || '' }}
|
RUSTFLAGS: ${{ matrix.asan == 'asan' && '-Z sanitizer=address' || '' }}
|
||||||
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
|
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
|
||||||
|
THP: ${{ matrix.protocol == 'v2' && '1' || '0'}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -234,7 +261,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-noasan
|
name: core-emu-${{ matrix.model }}-universal-debuglink-noasan-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
@ -257,6 +284,13 @@ jobs:
|
|||||||
coins: [universal, btconly]
|
coins: [universal, btconly]
|
||||||
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
asan: ${{ fromJSON(needs.param.outputs.asan) }}
|
||||||
lang: ${{ fromJSON(needs.param.outputs.test_lang) }}
|
lang: ${{ fromJSON(needs.param.outputs.test_lang) }}
|
||||||
|
protocol: [v1]
|
||||||
|
include:
|
||||||
|
- model: T2T1
|
||||||
|
coins: universal
|
||||||
|
asan: noasan
|
||||||
|
lang: en
|
||||||
|
protocol: v2
|
||||||
env:
|
env:
|
||||||
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
|
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
|
||||||
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model }}
|
||||||
@ -265,13 +299,14 @@ jobs:
|
|||||||
PYTEST_TIMEOUT: ${{ matrix.asan == 'asan' && 600 || 400 }}
|
PYTEST_TIMEOUT: ${{ matrix.asan == 'asan' && 600 || 400 }}
|
||||||
ACTIONS_DO_UI_TEST: ${{ matrix.coins == 'universal' && matrix.asan == 'noasan' }}
|
ACTIONS_DO_UI_TEST: ${{ matrix.coins == 'universal' && matrix.asan == 'noasan' }}
|
||||||
TEST_LANG: ${{ matrix.lang }}
|
TEST_LANG: ${{ matrix.lang }}
|
||||||
|
THP: ${{ matrix.protocol == 'v2' && '1' || '0'}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-${{ matrix.coins }}-debuglink-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-${{ matrix.coins }}-debuglink-${{ matrix.asan }}-protocol_${{ matrix.protocol }}
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
@ -280,7 +315,7 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-test-device-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.lang }}-${{ matrix.asan }}
|
name: core-test-device-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.lang }}-${{ matrix.asan }}-protocol_${{ matrix.protocol }}
|
||||||
path: tests/trezor.log
|
path: tests/trezor.log
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
if: always()
|
if: always()
|
||||||
@ -319,7 +354,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
@ -329,7 +364,7 @@ jobs:
|
|||||||
if: ${{ matrix.asan == 'asan' }}
|
if: ${{ matrix.asan == 'asan' }}
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-test-click-${{ matrix.model }}-${{ matrix.lang }}-${{ matrix.asan }}
|
name: core-test-click-${{ matrix.model }}-${{ matrix.lang }}-${{ matrix.asan }}-protocol_v1
|
||||||
path: tests/trezor.log
|
path: tests/trezor.log
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
if: always()
|
if: always()
|
||||||
@ -367,7 +402,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
@ -397,7 +432,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
@ -430,7 +465,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-noasan
|
name: core-emu-${{ matrix.model }}-universal-debuglink-noasan-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment # XXX poetry maybe not needed
|
- uses: ./.github/actions/environment # XXX poetry maybe not needed
|
||||||
@ -488,7 +523,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-firmware-${{ matrix.model }}-universal-normal # FIXME: s/normal/debuglink/
|
name: core-firmware-${{ matrix.model }}-universal-normal-protocol_v1 # FIXME: s/normal/debuglink/
|
||||||
path: core/build
|
path: core/build
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
- run: nix-shell --run "poetry run core/tools/size/checker.py core/build/firmware/firmware.elf"
|
- run: nix-shell --run "poetry run core/tools/size/checker.py core/build/firmware/firmware.elf"
|
||||||
@ -512,7 +547,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-firmware-${{ matrix.model }}-universal-normal
|
name: core-firmware-${{ matrix.model }}-universal-normal-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
- run: nix-shell --run "poetry run core/tools/size/compare_master.py core/build/firmware/firmware.elf -r firmware_elf_size_report.txt"
|
- run: nix-shell --run "poetry run core/tools/size/compare_master.py core/build/firmware/firmware.elf -r firmware_elf_size_report.txt"
|
||||||
@ -543,7 +578,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: cachix/install-nix-action@v23
|
- uses: cachix/install-nix-action@v23
|
||||||
@ -584,7 +619,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
@ -619,7 +654,7 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}
|
name: core-emu-${{ matrix.model }}-universal-debuglink-${{ matrix.asan }}-protocol_v1
|
||||||
path: core/build
|
path: core/build
|
||||||
- run: chmod +x core/build/unix/trezor-emu-core*
|
- run: chmod +x core/build/unix/trezor-emu-core*
|
||||||
- uses: ./.github/actions/environment
|
- uses: ./.github/actions/environment
|
||||||
@ -724,7 +759,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: core-emu*debuglink-noasan
|
pattern: core-emu*debuglink-noasan-protocol_v*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Configure aws credentials
|
- name: Configure aws credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
@ -747,7 +782,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
pattern: core-emu*debuglink-noasan
|
pattern: core-emu*debuglink-noasan-protocol_v*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
- name: Configure aws credentials
|
- name: Configure aws credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
Loading…
Reference in New Issue
Block a user