From cb53424d2a7433078fdbdac9be124f6e253b8995 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Wed, 4 Dec 2024 22:51:28 +0100 Subject: [PATCH] fixup! build(ci): add thp builds and tests --- .github/workflows/core.yml | 87 +++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 21 deletions(-) diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index c4a61669aa..819767751d 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -49,7 +49,7 @@ jobs: cat $GITHUB_OUTPUT core_firmware: - name: Build firmware + name: Build firmware (${{ matrix.model }}, ${{ matrix.coins }}, ${{ matrix.type }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest strategy: fail-fast: false @@ -70,6 +70,14 @@ jobs: coins: btconly type: debuglink protocol: v2 + - model: T3T1 + coins: universal + type: debuglink + protocol: v2 + - model: T3T1 + coins: btconly + type: debuglink + protocol: v2 exclude: - model: T3W1 type: production @@ -111,7 +119,7 @@ jobs: retention-days: 7 core_emu: - name: Build emu + name: Build emu (${{ matrix.model }}, ${{ matrix.coins }}, ${{ matrix.type }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest needs: param strategy: @@ -137,6 +145,16 @@ jobs: type: debuglink asan: noasan protocol: v2 + - model: T3T1 + coins: universal + type: debuglink + asan: noasan + protocol: v2 + - model: T3T1 + coins: btconly + type: debuglink + asan: noasan + protocol: v2 env: TREZOR_MODEL: ${{ matrix.model }} BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }} @@ -200,7 +218,7 @@ jobs: retention-days: 2 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 needs: param strategy: @@ -223,7 +241,7 @@ jobs: - run: nix-shell --run "poetry run make -C core 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 needs: - param @@ -275,7 +293,7 @@ jobs: # See artifacts for a comprehensive report of UI. # See [docs/tests/ui-tests](../tests/ui-tests.md) for more info. 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 needs: - param @@ -334,7 +352,7 @@ jobs: # Click tests - UI. # See [docs/tests/click-tests](../tests/click-tests.md) for more info. core_click_test: - name: Click tests + name: Click tests (${{ matrix.model }}, ${{ matrix.asan }}, ${{ matrix.lang }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest needs: - param @@ -346,6 +364,12 @@ jobs: model: [T2T1, T3B1, T3T1] asan: ${{ fromJSON(needs.param.outputs.asan) }} lang: ${{ fromJSON(needs.param.outputs.test_lang) }} + protocol: [v1] + include: + - model: T2T1 + asan: noasan + lang: en + protocol: v2 env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} # MULTICORE: 4 # more could interfere with other jobs @@ -357,7 +381,7 @@ jobs: submodules: recursive - uses: actions/download-artifact@v4 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 - run: chmod +x core/build/unix/trezor-emu-core* - uses: ./.github/actions/environment @@ -367,7 +391,7 @@ jobs: if: ${{ matrix.asan == 'asan' }} - uses: actions/upload-artifact@v4 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 retention-days: 7 if: always() @@ -384,7 +408,7 @@ jobs: # Upgrade tests. # See [docs/tests/upgrade-tests](../tests/upgrade-tests.md) for more info. core_upgrade_test: - name: Upgrade tests + name: Upgrade tests (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest needs: - param @@ -396,6 +420,7 @@ jobs: # FIXME: T3T1 https://github.com/trezor/trezor-firmware/issues/3595 model: [T2T1] asan: ${{ fromJSON(needs.param.outputs.asan) }} + protocol: [v1,v2] env: TREZOR_UPGRADE_TEST: core PYTEST_TIMEOUT: 400 @@ -405,7 +430,7 @@ jobs: submodules: recursive - uses: actions/download-artifact@v4 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 - run: chmod +x core/build/unix/trezor-emu-core* - uses: ./.github/actions/environment @@ -415,7 +440,7 @@ jobs: # Persistence tests - UI. core_persistence_test: - name: Persistence tests + name: Persistence tests (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest needs: - param @@ -426,6 +451,11 @@ jobs: matrix: model: [T2T1, T3B1, T3T1] asan: ${{ fromJSON(needs.param.outputs.asan) }} + protocol: [v1] + include: + - model: T2T1 + asan: noasan + protocol: v2 env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400 @@ -435,7 +465,7 @@ jobs: submodules: recursive - uses: actions/download-artifact@v4 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 - run: chmod +x core/build/unix/trezor-emu-core* - uses: ./.github/actions/environment @@ -562,7 +592,7 @@ jobs: # Monero tests. core_monero_test: - name: Monero test + name: Monero test (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest needs: - param @@ -572,6 +602,11 @@ jobs: matrix: model: [T2T1, T3B1, T3T1] asan: ${{ fromJSON(needs.param.outputs.asan) }} + protocol: [v1] + include: + - model: T2T1 + asan: noasan + protocol: v2 env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400 @@ -581,7 +616,7 @@ jobs: submodules: recursive - uses: actions/download-artifact@v4 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 - run: chmod +x core/build/unix/trezor-emu-core* - 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" - uses: actions/upload-artifact@v4 with: - name: core-test-monero-${{ matrix.model }}-${{ matrix.asan }} + name: core-test-monero-${{ matrix.model }}-${{ matrix.asan }}-protocol_${{matrix.protocol}} path: | tests/trezor.log core/tests/trezor_monero_tests.log @@ -603,7 +638,7 @@ jobs: # Tests for U2F and HID. core_u2f_test: - name: U2F test + name: U2F test (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest needs: - param @@ -613,6 +648,11 @@ jobs: matrix: model: [T2T1, T3B1, T3T1] asan: ${{ fromJSON(needs.param.outputs.asan) }} + protocol: [v1] + include: + - model: T2T1 + asan: noasan + protocol: v2 env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400 @@ -622,7 +662,7 @@ jobs: submodules: recursive - uses: actions/download-artifact@v4 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 - run: chmod +x core/build/unix/trezor-emu-core* - uses: ./.github/actions/environment @@ -630,7 +670,7 @@ jobs: - run: nix-shell --run "poetry run make -C core test_emu_u2f" - uses: actions/upload-artifact@v4 with: - name: core-test-u2f-${{ matrix.model }}-${{ matrix.asan }} + name: core-test-u2f-${{ matrix.model }}-${{ matrix.asan }}-protocol_${{matrix.protocol}} path: tests/trezor.log retention-days: 7 if: always() @@ -638,7 +678,7 @@ jobs: # FIDO2 device tests. core_fido2_test: - name: FIDO2 test + name: FIDO2 test (${{ matrix.model }}, ${{ matrix.asan }}${{ matrix.protocol=='v2' && ', THP' || ''}}) runs-on: ubuntu-latest needs: - param @@ -648,6 +688,11 @@ jobs: matrix: model: [T2T1, T3T1] # XXX T3B1 https://github.com/trezor/trezor-firmware/issues/2724 asan: ${{ fromJSON(needs.param.outputs.asan) }} + protocol: [v1] + include: + - model: T2T1 + asan: noasan + protocol: v2 env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400 @@ -657,14 +702,14 @@ jobs: submodules: recursive - uses: actions/download-artifact@v4 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 - run: chmod +x core/build/unix/trezor-emu-core* - uses: ./.github/actions/environment - run: nix-shell --run "poetry run make -C core test_emu_fido2" - uses: actions/upload-artifact@v4 with: - name: core-test-fido2-${{ matrix.model }}-${{ matrix.asan }} + name: core-test-fido2-${{ matrix.model }}-${{ matrix.asan }}-protocol_${{matrix.protocol}} path: | tests/trezor.log retention-days: 7