1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-26 07:11:25 +00:00

fixup! build(ci): add thp builds and tests

This commit is contained in:
M1nd3r 2024-12-04 22:51:28 +01:00
parent 4e89c4c7f7
commit cb53424d2a

View File

@ -49,7 +49,7 @@ jobs:
cat $GITHUB_OUTPUT cat $GITHUB_OUTPUT
core_firmware: core_firmware:
name: Build firmware name: Build firmware (${{ matrix.model }}, ${{ matrix.coins }}, ${{ matrix.type }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
@ -70,6 +70,14 @@ jobs:
coins: btconly coins: btconly
type: debuglink type: debuglink
protocol: v2 protocol: v2
- model: T3T1
coins: universal
type: debuglink
protocol: v2
- model: T3T1
coins: btconly
type: debuglink
protocol: v2
exclude: exclude:
- model: T3W1 - model: T3W1
type: production type: production
@ -111,7 +119,7 @@ jobs:
retention-days: 7 retention-days: 7
core_emu: core_emu:
name: Build emu name: Build emu (${{ matrix.model }}, ${{ matrix.coins }}, ${{ matrix.type }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: param needs: param
strategy: strategy:
@ -137,6 +145,16 @@ jobs:
type: debuglink type: debuglink
asan: noasan asan: noasan
protocol: v2 protocol: v2
- model: T3T1
coins: universal
type: debuglink
asan: noasan
protocol: v2
- model: T3T1
coins: btconly
type: debuglink
asan: noasan
protocol: v2
env: env:
TREZOR_MODEL: ${{ matrix.model }} TREZOR_MODEL: ${{ matrix.model }}
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }} BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
@ -200,7 +218,7 @@ jobs:
retention-days: 2 retention-days: 2
core_unit_python_test: core_unit_python_test:
name: Python unit tests (${{ matrix.model }}, ${{ matrix.asan }}, protocol_${{ matrix.protocol}}) name: Python unit tests (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: param needs: param
strategy: strategy:
@ -223,7 +241,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 (${{ matrix.model }}, ${{ matrix.asan }}, protocol_${{ matrix.protocol}}) name: Rust unit tests (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -275,7 +293,7 @@ jobs:
# See artifacts for a comprehensive report of UI. # See artifacts for a comprehensive report of UI.
# See [docs/tests/ui-tests](../tests/ui-tests.md) for more info. # See [docs/tests/ui-tests](../tests/ui-tests.md) for more info.
core_device_test: core_device_test:
name: Device tests name: Device tests (${{ matrix.model }}, ${{ matrix.coins }}, ${{ matrix.asan }}, ${{ matrix.lang }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -334,7 +352,7 @@ jobs:
# Click tests - UI. # Click tests - UI.
# See [docs/tests/click-tests](../tests/click-tests.md) for more info. # See [docs/tests/click-tests](../tests/click-tests.md) for more info.
core_click_test: core_click_test:
name: Click tests name: Click tests (${{ matrix.model }}, ${{ matrix.asan }}, ${{ matrix.lang }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -346,6 +364,12 @@ jobs:
model: [T2T1, T3B1, T3T1] model: [T2T1, T3B1, T3T1]
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
asan: noasan
lang: en
protocol: v2
env: env:
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
# MULTICORE: 4 # more could interfere with other jobs # MULTICORE: 4 # more could interfere with other jobs
@ -357,7 +381,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 }}-protocol_v1 name: core-emu-${{ matrix.model }}-universal-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
@ -367,7 +391,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 }}-protocol_v1 name: core-test-click-${{ matrix.model }}-${{ 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()
@ -384,7 +408,7 @@ jobs:
# Upgrade tests. # Upgrade tests.
# See [docs/tests/upgrade-tests](../tests/upgrade-tests.md) for more info. # See [docs/tests/upgrade-tests](../tests/upgrade-tests.md) for more info.
core_upgrade_test: core_upgrade_test:
name: Upgrade tests name: Upgrade tests (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -396,6 +420,7 @@ jobs:
# FIXME: T3T1 https://github.com/trezor/trezor-firmware/issues/3595 # FIXME: T3T1 https://github.com/trezor/trezor-firmware/issues/3595
model: [T2T1] model: [T2T1]
asan: ${{ fromJSON(needs.param.outputs.asan) }} asan: ${{ fromJSON(needs.param.outputs.asan) }}
protocol: [v1,v2]
env: env:
TREZOR_UPGRADE_TEST: core TREZOR_UPGRADE_TEST: core
PYTEST_TIMEOUT: 400 PYTEST_TIMEOUT: 400
@ -405,7 +430,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 }}-protocol_v1 name: core-emu-${{ matrix.model }}-universal-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
@ -415,7 +440,7 @@ jobs:
# Persistence tests - UI. # Persistence tests - UI.
core_persistence_test: core_persistence_test:
name: Persistence tests name: Persistence tests (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -426,6 +451,11 @@ jobs:
matrix: matrix:
model: [T2T1, T3B1, T3T1] model: [T2T1, T3B1, T3T1]
asan: ${{ fromJSON(needs.param.outputs.asan) }} asan: ${{ fromJSON(needs.param.outputs.asan) }}
protocol: [v1]
include:
- model: T2T1
asan: noasan
protocol: v2
env: env:
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
PYTEST_TIMEOUT: 400 PYTEST_TIMEOUT: 400
@ -435,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-${{ matrix.asan }}-protocol_v1 name: core-emu-${{ matrix.model }}-universal-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
@ -562,7 +592,7 @@ jobs:
# Monero tests. # Monero tests.
core_monero_test: core_monero_test:
name: Monero test name: Monero test (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -572,6 +602,11 @@ jobs:
matrix: matrix:
model: [T2T1, T3B1, T3T1] model: [T2T1, T3B1, T3T1]
asan: ${{ fromJSON(needs.param.outputs.asan) }} asan: ${{ fromJSON(needs.param.outputs.asan) }}
protocol: [v1]
include:
- model: T2T1
asan: noasan
protocol: v2
env: env:
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
PYTEST_TIMEOUT: 400 PYTEST_TIMEOUT: 400
@ -581,7 +616,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 }}-protocol_v1 name: core-emu-${{ matrix.model }}-universal-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: cachix/install-nix-action@v23 - uses: cachix/install-nix-action@v23
@ -592,7 +627,7 @@ jobs:
- run: nix-shell --arg fullDeps true --run "unset _PYTHON_SYSCONFIGDATA_NAME && poetry run make -C core test_emu_monero" - run: nix-shell --arg fullDeps true --run "unset _PYTHON_SYSCONFIGDATA_NAME && poetry run make -C core test_emu_monero"
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: core-test-monero-${{ matrix.model }}-${{ matrix.asan }} name: core-test-monero-${{ matrix.model }}-${{ matrix.asan }}-protocol_${{matrix.protocol}}
path: | path: |
tests/trezor.log tests/trezor.log
core/tests/trezor_monero_tests.log core/tests/trezor_monero_tests.log
@ -603,7 +638,7 @@ jobs:
# Tests for U2F and HID. # Tests for U2F and HID.
core_u2f_test: core_u2f_test:
name: U2F test name: U2F test (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -613,6 +648,11 @@ jobs:
matrix: matrix:
model: [T2T1, T3B1, T3T1] model: [T2T1, T3B1, T3T1]
asan: ${{ fromJSON(needs.param.outputs.asan) }} asan: ${{ fromJSON(needs.param.outputs.asan) }}
protocol: [v1]
include:
- model: T2T1
asan: noasan
protocol: v2
env: env:
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
PYTEST_TIMEOUT: 400 PYTEST_TIMEOUT: 400
@ -622,7 +662,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 }}-protocol_v1 name: core-emu-${{ matrix.model }}-universal-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
@ -630,7 +670,7 @@ jobs:
- run: nix-shell --run "poetry run make -C core test_emu_u2f" - run: nix-shell --run "poetry run make -C core test_emu_u2f"
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: core-test-u2f-${{ matrix.model }}-${{ matrix.asan }} name: core-test-u2f-${{ matrix.model }}-${{ matrix.asan }}-protocol_${{matrix.protocol}}
path: tests/trezor.log path: tests/trezor.log
retention-days: 7 retention-days: 7
if: always() if: always()
@ -638,7 +678,7 @@ jobs:
# FIDO2 device tests. # FIDO2 device tests.
core_fido2_test: core_fido2_test:
name: FIDO2 test name: FIDO2 test (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}})
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- param - param
@ -648,6 +688,11 @@ jobs:
matrix: matrix:
model: [T2T1, T3T1] # XXX T3B1 https://github.com/trezor/trezor-firmware/issues/2724 model: [T2T1, T3T1] # XXX T3B1 https://github.com/trezor/trezor-firmware/issues/2724
asan: ${{ fromJSON(needs.param.outputs.asan) }} asan: ${{ fromJSON(needs.param.outputs.asan) }}
protocol: [v1]
include:
- model: T2T1
asan: noasan
protocol: v2
env: env:
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
PYTEST_TIMEOUT: 400 PYTEST_TIMEOUT: 400
@ -657,14 +702,14 @@ 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 }}-protocol_v1 name: core-emu-${{ matrix.model }}-universal-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
- run: nix-shell --run "poetry run make -C core test_emu_fido2" - run: nix-shell --run "poetry run make -C core test_emu_fido2"
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: core-test-fido2-${{ matrix.model }}-${{ matrix.asan }} name: core-test-fido2-${{ matrix.model }}-${{ matrix.asan }}-protocol_${{matrix.protocol}}
path: | path: |
tests/trezor.log tests/trezor.log
retention-days: 7 retention-days: 7