From 698b632acb25af5316ccff5547bc7dba91fd8ec7 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Wed, 15 Jul 2020 11:43:10 +0200 Subject: [PATCH] ci: add btconly debug build and run hardware tests for it --- ci/build.yml | 18 +++++++++++++++++- ci/deploy.yml | 24 ++++++++++++++++++++++-- ci/test.yml | 31 +++++++++++++++++++++++++++++-- 3 files changed, 68 insertions(+), 5 deletions(-) diff --git a/ci/build.yml b/ci/build.yml index 5ef532157..9b00dd87e 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -148,7 +148,7 @@ legacy fw regular build: - trezor-fw-regular-*.*.*-$CI_COMMIT_SHORT_SHA.bin expire_in: 1 week -legacy fw debug build: +legacy fw regular debug build: stage: build variables: DEBUG_LINK: "1" @@ -178,6 +178,22 @@ legacy fw btconly build: - trezor-fw-btconly-*.*.*-$CI_COMMIT_SHORT_SHA.bin expire_in: 1 week +legacy fw btconly debug build: + stage: build + variables: + BITCOIN_ONLY: "1" + MEMORY_PROTECT: "0" + DEBUG_LINK: "1" + script: + - nix-shell --run "pipenv run legacy/script/cibuild" + - nix-shell --run "pipenv run ./tools/check-bitcoin-only legacy/firmware/trezor.bin" + - mv legacy/firmware/trezor.bin trezor-fw-btconly-debug-$LEGACY_VERSION-$CI_COMMIT_SHORT_SHA.bin + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - trezor-fw-btconly-*.*.*-$CI_COMMIT_SHORT_SHA.bin + expire_in: 1 week + legacy emu regular build: stage: build variables: diff --git a/ci/deploy.yml b/ci/deploy.yml index 7f685ddce..b790a4b12 100644 --- a/ci/deploy.yml +++ b/ci/deploy.yml @@ -102,13 +102,13 @@ release core fw regular debug deploy: tags: - deploy -release legacy fw debug deploy: +release legacy fw regular debug deploy: stage: deploy variables: DEPLOY_DIRECTORY: "releases/firmwares" before_script: [] # no pipenv dependencies: - - legacy fw debug build + - legacy fw regular debug build script: - export VERSION=$(./tools/version.sh legacy/firmware/version.h) - export NAME="trezor-fw-regular-debug-$VERSION-$CI_COMMIT_SHORT_SHA.bin" @@ -122,6 +122,26 @@ release legacy fw debug deploy: tags: - deploy +release legacy fw btconly debug deploy: + stage: deploy + variables: + DEPLOY_DIRECTORY: "releases/firmwares" + before_script: [] # no pipenv + dependencies: + - legacy fw btconly debug build + script: + - export VERSION=$(./tools/version.sh legacy/firmware/version.h) + - export NAME="trezor-fw-btconly-debug-$VERSION-$CI_COMMIT_SHORT_SHA.bin" + - echo "Deploying to ${DEPLOY_DIRECTORY}/$NAME" + - mkdir -p "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}" + - rsync --delete -va $NAME "${DEPLOY_BASE_DIR}/${DEPLOY_DIRECTORY}/$NAME" + only: + - /^legacy\// + except: + - branches # run for tags only + tags: + - deploy + # Release candidates diff --git a/ci/test.yml b/ci/test.yml index 57aaffd07..b91056031 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -300,7 +300,7 @@ storage test: when: always # Hardware -hardware legacy device test: +hardware legacy regular device test: stage: test only: - schedules # nightly build @@ -309,7 +309,34 @@ hardware legacy device test: tags: - tpmb dependencies: - - legacy fw debug build + - legacy fw regular debug build + script: + - cd ci/hardware_tests + - nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} start" + - nix-shell --run "cd ../.. && pipenv sync" + - nix-shell --run "pipenv run python bootstrap.py" + - nix-shell --run "pipenv run python bootstrap.py ../../trezor-*.bin" + - nix-shell --run "pipenv run pytest ../../tests/device_tests" + - nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} stop" + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - ci/hardware_tests/video*.mp4 + expire_in: 2 days + when: always + +hardware legacy btconly device test: + stage: test + variables: + TREZOR_PYTEST_SKIP_ALTCOINS: 1 + only: + - schedules # nightly build + - /^legacy\// + - /^release\// + tags: + - tpmb + dependencies: + - legacy fw btconly debug build script: - cd ci/hardware_tests - nix-shell --run "./record_video.sh ${CI_COMMIT_SHORT_SHA} start"