Skip to content

ci: hardware tests for github actions #16

ci: hardware tests for github actions

ci: hardware tests for github actions #16

Workflow file for this run

name: Hardware tests
on:
schedule:
- cron: '15 23 * * *' # every day @ 23:15
workflow_dispatch:
pull_request: # TODO remove
jobs:
core_device_test:
if: false # XXX XXX XXX
name: Device tests
runs-on:
- self-hosted
- ${{ matrix.model == 'T2B1' && 'hw-t2b1' || 'runner5' }} # FIXME use hw-t2t1 after it's removed from runner0
strategy:
fail-fast: false
matrix:
model: [T2T1, T2B1] # FIXME t1b1
coins: [universal, btconly]
env:
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }}
TREZOR_PYTEST_SKIP_ALTCOINS: ${{ matrix.coins == 'btconly' && '1' || '0' }}
PYTEST_TIMEOUT: 1200
PYOPT: 0
DISABLE_OPTIGA: 1
BOOTLOADER_DEVEL: ${{ matrix.model == 'T2B1' && '1' || '0' }}
TESTOPTS: "-k 'not authenticate and not recovery and not lots'"
TT_UHUB_PORT: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --arg hardwareTest true --run uhubctl
- run: nix-shell --run "poetry run make -C core build_firmware"
- run: nix-shell --arg hardwareTest true --run "poetry run python ci/hardware_tests/bootstrap.py ${{ matrix.model }} core/build/firmware/firmware.bin"
- run: nix-shell --run "poetry run trezorctl list"
- run: nix-shell --run "poetry run trezorctl get-features"
- run: |
nix-shell --arg hardwareTest true --run "ls -l /dev/tty*"
# log serial console to file; sleep is used because tio needs stdin that is not /dev/null
nix-shell --arg hardwareTest true --run "sleep 8h | tio --no-autoconnect /dev/ttyTREZOR &> trezor.log" &
nix-shell --run "poetry run pytest -v tests/device_tests"
- run: tail -n50 trezor.log || true
if: failure()
- uses: actions/upload-artifact@v3
with:
name: core-hardware-${{ matrix.model }}
path: trezor.log
retention-days: 7
if: always()
core_monero_test:
if: false # XXX XXX XXX
name: Monero tests
runs-on:
- self-hosted
- ${{ matrix.model == 'T2B1' && 'hw-t2b1' || 'runner5' }} # FIXME use hw-t2t1 after it's removed from runner0
strategy:
fail-fast: false
matrix:
model: [T2T1, T2B1] # FIXME t1b1
env:
TREZOR_MODEL: ${{ matrix.model == 'T2T1' && 'T' || 'R' }}
PYTEST_TIMEOUT: 1200
PYOPT: 0
DISABLE_OPTIGA: 1
BOOTLOADER_DEVEL: ${{ matrix.model == 'T2B1' && '1' || '0' }}
TT_UHUB_PORT: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --arg hardwareTest true --run uhubctl
- run: nix-shell --run "poetry run make -C core build_firmware"
- run: nix-shell --arg hardwareTest true --run "poetry run python ci/hardware_tests/bootstrap.py ${{ matrix.model }} core/build/firmware/firmware.bin"
- run: nix-shell --run "poetry run trezorctl list"
- run: nix-shell --run "poetry run trezorctl get-features"
- run: |
nix-shell --arg hardwareTest true --run "ls -l /dev/tty*"
# log serial console to file; sleep is used because tio needs stdin that is not /dev/null
nix-shell --arg hardwareTest true --run "sleep 8h | tio --no-autoconnect /dev/ttyTREZOR &> trezor.log" &
nix-shell --arg fullDeps true --run "cd ../../core/tests && ./run_tests_device_emu_monero.sh $TESTOPTS"
- run: tail -n50 trezor.log || true
if: failure()
- uses: actions/upload-artifact@v3
with:
name: core-hardware-${{ matrix.model }}
path: trezor.log
retention-days: 7
if: always()
legacy_device_test:
name: Device tests T1B1
runs-on:
- self-hosted
- hw-t1b1
strategy:
fail-fast: false
matrix:
coins: [universal, btconly]
env:
TREZOR_PYTEST_SKIP_ALTCOINS: ${{ matrix.coins == 'btconly' && '1' || '0' }}
PYTEST_TIMEOUT: 1200
# TESTOPTS: "-k 'not authenticate and not recovery and not lots'"
#TT_UHUB_PORT: 1
BITCOIN_ONLY: ${{ matrix.coins == 'universal' && '0' || '1' }}
DEBUG_LINK: 1
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: ./.github/actions/environment
- run: nix-shell --arg hardwareTest true --run uhubctl
- run: nix-shell --run "poetry run legacy/script/setup"
- run: nix-shell --run "export PRODUCTION=0 && poetry run legacy/script/cibuild"
#- run: nix-shell --arg hardwareTest true --run "poetry run python ci/hardware_tests/bootstrap.py T1B1 legacy/firmware/firmware-*.bin"
#- run: nix-shell --run "poetry run trezorctl list; poetry run trezorctl get-features"
#- run: nix-shell --run "poetry run pytest -v tests/device_tests"
- run: nix-shell --arg hardwareTest true --run "ci/hardware_tests/t1_hw_test.sh"