1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 07:18:09 +00:00

ci: add arm emulator build in github actions

This commit is contained in:
vdovhanych 2024-07-29 12:02:07 +02:00 committed by matejcik
parent aedef2d69d
commit 415d62bc66
2 changed files with 74 additions and 4 deletions

View File

@ -126,6 +126,44 @@ jobs:
core/build/bootloader_emu/bootloader.elf core/build/bootloader_emu/bootloader.elf
retention-days: 7 retention-days: 7
core_emu_arm:
if: github.event_name == 'schedule'
name: Build emu arm
runs-on: ubuntu-latest-arm64
needs: param
strategy:
fail-fast: false
matrix:
model: [T2T1, T2B1, T3T1]
coins: [universal]
type: [debuglink]
asan: [noasan]
exclude:
- type: normal
asan: asan
env:
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || matrix.model == 'T2B1' && 'R' || matrix.model }}
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
PYOPT: ${{ matrix.type == 'debuglink' && '0' || '1' }}
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
LSAN_OPTIONS: "suppressions=../../asan_suppressions.txt"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --run "poetry run make -C core build_bootloader_emu"
if: matrix.coins == 'universal'
- run: nix-shell --run "poetry run make -C core build_unix_frozen"
- run: mv core/build/unix/trezor-emu-core core/build/unix/trezor-emu-arm-core-${{ matrix.model }}-${{ matrix.coins }}
- uses: actions/upload-artifact@v4
with:
name: core-emu-arm-${{ matrix.model }}-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}
path: |
core/build/unix/trezor-emu-*
core/build/bootloader_emu/bootloader.elf
retention-days: 2
core_unit_python_test: core_unit_python_test:
name: Python unit tests name: Python unit tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -708,7 +746,9 @@ jobs:
name: Upload emulator binaries name: Upload emulator binaries
if: github.event_name == 'schedule' if: github.event_name == 'schedule'
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: core_emu needs:
- core_emu
- core_emu_arm
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:

View File

@ -74,6 +74,34 @@ jobs:
legacy/firmware/trezor-emu-legacy* legacy/firmware/trezor-emu-legacy*
retention-days: 7 retention-days: 7
legacy_emu_arm:
if: github.event_name == 'schedule'
name: Emulator arm
runs-on: ubuntu-latest-arm64
strategy:
matrix:
coins: [universal]
type: [debuglink]
asan: ${{ fromJSON(github.event_name == 'schedule' && '["noasan", "asan"]' || '["noasan"]') }}
env:
EMULATOR: 1
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
DEBUG_LINK: ${{ matrix.type == 'debuglink' && '1' || '0' }}
ADDRESS_SANITIZER: ${{ matrix.asan == 'asan' && '1' || '0' }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --run "poetry run legacy/script/cibuild"
- run: mv legacy/firmware/trezor.elf legacy/firmware/trezor-emu-arm-legacy-T1B1-${{ matrix.coins }}
- uses: actions/upload-artifact@v4
with:
name: legacy-emu-arm-${{ matrix.coins }}-${{ matrix.type }}-${{ matrix.asan }}
path: |
legacy/firmware/trezor-emu-arm-legacy*
retention-days: 7
legacy_device_test: legacy_device_test:
name: Device test name: Device test
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -202,11 +230,13 @@ jobs:
# TODO: always run if comment already exists # TODO: always run if comment already exists
if: ${{ steps.check-fixtures-changed.outputs.FIXTURES_CHANGED == '1' }} if: ${{ steps.check-fixtures-changed.outputs.FIXTURES_CHANGED == '1' }}
core_upload_emu: legacy_upload_emu:
name: Upload emulator binaries name: Upload emulator binaries
if: github.event_name == 'schedule' if: github.event_name == 'schedule'
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: legacy_emu needs:
- legacy_emu
- legacy_emu_arm
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
@ -220,5 +250,5 @@ jobs:
continue-on-error: true continue-on-error: true
- run: | - run: |
mkdir emulators mkdir emulators
cp trezor-emu-legacy* emulators cp trezor-emu-* emulators
aws s3 sync --no-progress emulators s3://data.trezor.io/dev/firmware/emu-nightly aws s3 sync --no-progress emulators s3://data.trezor.io/dev/firmware/emu-nightly