diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index d35a3606928..d2f26ab3190 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -2,6 +2,11 @@ name: Core on: pull_request: + types: + - opened + - reopened + - synchronize + - labeled workflow_dispatch: schedule: - cron: '15 23 * * *' # every day @ 23:15 @@ -20,6 +25,19 @@ env: |All |[main](https://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}/index.html)([screens](https://data.trezor.io/dev/firmware/master_diff/${{ github.run_id }}/master_diff.html)) || jobs: + param: + name: Determine pipeline parameters + runs-on: ubuntu-latest + outputs: + test_lang: ${{ steps.set_vars.outputs.test_lang }} + asan: ${{ steps.set_vars.outputs.asan }} + steps: + - id: set_vars + run: | + echo test_lang=${{ github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'tests' && '["en", "cs", "fr", "de", "es"]' || '["en"]' }} >> $GITHUB_OUTPUT + echo asan=${{ github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]' }} >> $GITHUB_OUTPUT + cat $GITHUB_OUTPUT + core_firmware: name: Build firmware runs-on: ubuntu-latest @@ -71,6 +89,7 @@ jobs: core_emu: name: Build emu runs-on: ubuntu-latest + needs: param strategy: fail-fast: false matrix: @@ -78,7 +97,7 @@ jobs: coins: [universal, btconly] # type: [normal, debuglink] type: [debuglink] - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} exclude: - type: normal asan: asan @@ -109,11 +128,12 @@ jobs: core_unit_python_test: name: Python unit tests runs-on: ubuntu-latest + needs: param strategy: fail-fast: false matrix: model: [T2T1, T2B1] - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} env: TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }} ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }} @@ -129,12 +149,14 @@ jobs: core_unit_rust_test: name: Rust unit tests runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1, T2B1] - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} # T2B1 fails due to rust clippy error which is hard to reproduce, see discussion here: # https://github.com/trezor/trezor-firmware/pull/2196 # The problem might be in conflicting versions of clippy, let's see if this helps: @@ -183,15 +205,17 @@ jobs: core_device_test: name: Device tests runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1, T2B1] coins: [universal, btconly] - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} # lang: ${{ fromJSON(github.event_name == 'schedule' && '["en", "cs", "fr", "de", "es"]' || '["en"]') }} - lang: [en, cs, fr, de, es] + lang: ${{ fromJSON(needs.param.outputs.test_lang) }} # T2B1 fails due to https://github.com/trezor/trezor-firmware/issues/3280 # remove after single global layout is implemented (or bug above fixed): exclude: @@ -241,14 +265,16 @@ jobs: core_click_test: name: Click tests runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1, T2B1] - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} # lang: ${{ fromJSON(github.event_name == 'schedule' && '["en", "cs", "fr", "de", "es"]' || '["en"]') }} - lang: [en, cs, fr, de, es] + lang: ${{ fromJSON(needs.param.outputs.test_lang) }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} # MULTICORE: 4 # more could interfere with other jobs @@ -290,12 +316,14 @@ jobs: core_upgrade_test: name: Upgrade tests runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1] # FIXME: T2B1 https://github.com/trezor/trezor-firmware/issues/2724 - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} env: TREZOR_UPGRADE_TEST: core PYTEST_TIMEOUT: 400 @@ -317,12 +345,14 @@ jobs: core_persistence_test: name: Persistence tests runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1] # TODO T2B1 https://github.com/trezor/trezor-firmware/issues/2724 - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400 @@ -463,12 +493,14 @@ jobs: core_monero_test: name: Monero test runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1, T2B1] - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400 @@ -506,12 +538,14 @@ jobs: core_u2f_test: name: U2F test runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1, T2B1] - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400 @@ -544,12 +578,14 @@ jobs: core_fido2_test: name: FIDO2 test runs-on: ubuntu-latest - needs: core_emu + needs: + - param + - core_emu strategy: fail-fast: false matrix: model: [T2T1] # XXX T2B1 https://github.com/trezor/trezor-firmware/issues/2724 - asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }} + asan: ${{ fromJSON(needs.param.outputs.asan) }} env: TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }} PYTEST_TIMEOUT: 400