Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmilata committed Mar 5, 2024
1 parent 67df144 commit 35d7021
Showing 1 changed file with 56 additions and 20 deletions.
76 changes: 56 additions & 20 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Core

on:
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
workflow_dispatch:
schedule:
- cron: '15 23 * * *' # every day @ 23:15
Expand All @@ -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
Expand Down Expand Up @@ -71,14 +89,15 @@ jobs:
core_emu:
name: Build emu
runs-on: ubuntu-latest
needs: param
strategy:
fail-fast: false
matrix:
model: [T2T1, T2B1]
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
Expand Down Expand Up @@ -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' }}
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 35d7021

Please sign in to comment.