From b1f435e1784fafe24ff78d92de9428e6b3925e04 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 22 Aug 2019 20:18:44 +0200 Subject: [PATCH] ci: test BITCOIN_ONLY firmware --- ci/build.yml | 35 ++++++++++++++++++++++++++++++++++ ci/test.yml | 23 ++++++++++++++++++++++ tests/device_tests/conftest.py | 4 ++++ 3 files changed, 62 insertions(+) diff --git a/ci/build.yml b/ci/build.yml index db2eb72a9..25e2c9656 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -24,6 +24,20 @@ build core firmware: - core/build/bootloader/bootloader.bin expire_in: 1 week +build core firmware bitcoinonly: + stage: build + variables: + BITCOIN_ONLY: "1" + script: + - cd core + - pipenv run make build_firmware + - mv build/firmware/firmware.bin build/firmware/firmware-bitcoinonly.bin + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - core/build/firmware/firmware-bitcoinonly.bin + expire_in: 1 week + build core unix: stage: build script: @@ -42,6 +56,21 @@ build core unix frozen: - core/src/trezor/res/resources.py expire_in: 1 day +build core unix frozen bitcoinonly: + stage: build + variables: + BITCOIN_ONLY: "1" + script: + - cd core + - pipenv run make build_unix_frozen + - mv build/unix/micropython build/unix/micropython-bitcoinonly + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - core/build/unix/micropython-bitcoinonly + - core/src/trezor/res/resources.py + expire_in: 1 day + # Crypto @@ -110,3 +139,9 @@ build legacy emu bitcoinonly: script: - cd legacy - pipenv run script/cibuild + - mv firmware/trezor.elf firmware/trezor-bitcoinonly.elf + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - legacy/firmware/trezor-bitcoinonly.elf + expire_in: 1 day diff --git a/ci/test.yml b/ci/test.yml index d8549d62c..48e8d6598 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -18,6 +18,17 @@ test core unix device: - cd core - pipenv run make test_emu +test core unix device bitcoinonly: + stage: test + dependencies: + - build core unix frozen bitcoinonly + variables: + MICROPYTHON: "../build/unix/micropython-bitcoinonly" + TREZOR_PYTEST_SKIP_ALTCOINS: 1 + script: + - cd core + - pipenv run make test_emu + test core unix monero: stage: test dependencies: @@ -54,6 +65,18 @@ test legacy emu: - cd legacy - pipenv run script/test +test legacy emu bitcoinonly: + stage: test + dependencies: + - build legacy emu bitcoinonly + variables: + EMULATOR: "1" + EMULATOR_BINARY: "firmware/trezor-bitcoinonly.elf" + TREZOR_PYTEST_SKIP_ALTCOINS: 1 + script: + - cd legacy + - pipenv run script/test + # Python diff --git a/tests/device_tests/conftest.py b/tests/device_tests/conftest.py index 59036c02c..5640cc461 100644 --- a/tests/device_tests/conftest.py +++ b/tests/device_tests/conftest.py @@ -127,6 +127,10 @@ def pytest_runtest_setup(item): if item.get_closest_marker("skip_t1") and item.get_closest_marker("skip_t2"): pytest.fail("Don't skip tests for both trezors!") + if item.get_closest_marker("altcoin") and os.environ.get( + "TREZOR_PYTEST_SKIP_ALTCOINS", 0 + ): + pytest.skip("Skipping altcoin test") if item.get_closest_marker("skip_t2") and TREZOR_VERSION == 2: pytest.skip("Test excluded on Trezor T") if item.get_closest_marker("skip_t1") and TREZOR_VERSION == 1: