From b5c909417ededec926be4d6a6433c4ef07f43d82 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Mon, 19 Aug 2019 14:24:32 +0200 Subject: [PATCH] ci: split jobs based on stage not project --- .gitlab-ci.yml | 9 ++--- ci/build.yml | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ ci/core.yml | 62 -------------------------------- ci/crypto.yml | 23 ------------ ci/legacy.yml | 53 --------------------------- ci/python.yml | 7 ---- ci/storage.yml | 9 ----- ci/test.yml | 75 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 176 insertions(+), 160 deletions(-) create mode 100644 ci/build.yml delete mode 100644 ci/core.yml delete mode 100644 ci/crypto.yml delete mode 100644 ci/legacy.yml delete mode 100644 ci/python.yml delete mode 100644 ci/storage.yml create mode 100644 ci/test.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef32af3175..b723f2369f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,9 +32,6 @@ before_script: include: - ci/environment.yml - - ci/prebuild.yml # common, style - - ci/core.yml - - ci/legacy.yml - - ci/python.yml - - ci/crypto.yml - - ci/storage.yml + - ci/prebuild.yml + - ci/build.yml + - ci/test.yml diff --git a/ci/build.yml b/ci/build.yml new file mode 100644 index 0000000000..64af5308f0 --- /dev/null +++ b/ci/build.yml @@ -0,0 +1,98 @@ +image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment + +variables: + SDL_VIDEODRIVER: "dummy" + XDG_RUNTIME_DIR: "/var/tmp" + + +# Core + +build core firmware: + stage: build + script: + - cd core + - pipenv run make build_cross + - pipenv run make build_boardloader + - pipenv run make build_bootloader + - pipenv run make build_prodtest + - pipenv run make build_firmware + - pipenv run make sizecheck + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - core/build/firmware/firmware.bin + - core/build/bootloader/bootloader.bin + expire_in: 1 week + +build core unix: + stage: build + script: + - cd core + - pipenv run make build_unix + +build core unix frozen: + stage: build + script: + - cd core + - pipenv run make build_unix_frozen + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + untracked: true + expire_in: 1 day + + +# Crypto + +build crypto: + stage: build + script: + - cd crypto + - pipenv run make + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + untracked: true + expire_in: 1 day + + +# Legacy + +# TODO: add clang https://github.com/trezor/trezor-firmware/issues/44 +build legacy firmware: + stage: build + script: + - cd legacy + - pipenv run script/cibuild + - pipenv run make -C bootloader + - pipenv run make -C demo + +build legacy firmware debug: + stage: build + variables: + DEBUG_LINK: "1" + script: + - cd legacy + - pipenv run script/cibuild + +build legacy firmware bitcoinonly: + stage: build + variables: + BITCOIN_ONLY: "1" + script: + - cd legacy + - pipenv run script/cibuild + +build legacy emu: + stage: build + variables: + DEBUG_LINK: "1" + EMULATOR: "1" + script: + - cd legacy + - pipenv run script/cibuild + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + untracked: true + expire_in: 1 day + + + diff --git a/ci/core.yml b/ci/core.yml deleted file mode 100644 index 1282e3e55d..0000000000 --- a/ci/core.yml +++ /dev/null @@ -1,62 +0,0 @@ -image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment - -variables: - SDL_VIDEODRIVER: "dummy" - XDG_RUNTIME_DIR: "/var/tmp" - -build core firmware: - stage: build - script: - - cd core - - pipenv run make build_cross - - pipenv run make build_boardloader - - pipenv run make build_bootloader - - pipenv run make build_prodtest - - pipenv run make build_firmware - - pipenv run make sizecheck - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - paths: - - core/build/firmware/firmware.bin - - core/build/bootloader/bootloader.bin - expire_in: 1 week - -build core unix: - stage: build - script: - - cd core - - pipenv run make build_unix - -build core unix frozen: - stage: build - script: - - cd core - - pipenv run make build_unix_frozen - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - untracked: true - expire_in: 1 day - -test core unix unit: - stage: test - dependencies: - - build core unix frozen - script: - - cd core - - pipenv run make test - -test core unix device: - stage: test - dependencies: - - build core unix frozen - script: - - cd core - - pipenv run make test_emu - -test core unix monero: - stage: test - dependencies: - - build core unix frozen - script: - - cd core - - pipenv run make test_emu_monero diff --git a/ci/crypto.yml b/ci/crypto.yml deleted file mode 100644 index 4c07974aa5..0000000000 --- a/ci/crypto.yml +++ /dev/null @@ -1,23 +0,0 @@ -image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment - -build crypto: - stage: build - script: - - cd crypto - - pipenv run make - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - untracked: true - expire_in: 1 day - -test crypto: - stage: test - dependencies: - - build crypto - script: - - cd crypto - - ./tests/aestst - - ./tests/test_check - - CK_TIMEOUT_MULTIPLIER=20 valgrind -q --error-exitcode=1 ./tests/test_check - - ./tests/test_openssl 1000 - - ITERS=10 pipenv run pytest tests diff --git a/ci/legacy.yml b/ci/legacy.yml deleted file mode 100644 index 3d7b0d2698..0000000000 --- a/ci/legacy.yml +++ /dev/null @@ -1,53 +0,0 @@ -image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment - -variables: - SDL_VIDEODRIVER: "dummy" - XDG_RUNTIME_DIR: "/var/tmp" - -# TODO: add clang https://github.com/trezor/trezor-firmware/issues/44 -build legacy firmware: - stage: build - script: - - cd legacy - - pipenv run script/cibuild - - pipenv run make -C bootloader - - pipenv run make -C demo - -build legacy firmware debug: - stage: build - variables: - DEBUG_LINK: "1" - script: - - cd legacy - - pipenv run script/cibuild - -build legacy firmware bitcoinonly: - stage: build - variables: - BITCOIN_ONLY: "1" - script: - - cd legacy - - pipenv run script/cibuild - -build legacy emu: - stage: build - variables: - DEBUG_LINK: "1" - EMULATOR: "1" - script: - - cd legacy - - pipenv run script/cibuild - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" - untracked: true - expire_in: 1 day - -test legacy emu: - stage: test - dependencies: - - build legacy emu - variables: - EMULATOR: "1" - script: - - cd legacy - - pipenv run script/test diff --git a/ci/python.yml b/ci/python.yml deleted file mode 100644 index d333717b8f..0000000000 --- a/ci/python.yml +++ /dev/null @@ -1,7 +0,0 @@ -image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment - -test python: - stage: test - script: - - cd python - - pipenv run tox diff --git a/ci/storage.yml b/ci/storage.yml deleted file mode 100644 index be79c78b09..0000000000 --- a/ci/storage.yml +++ /dev/null @@ -1,9 +0,0 @@ -image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment - -test storage: - stage: test - dependencies: [] - script: - - cd storage/tests - - pipenv run make build - - pipenv run make tests_all diff --git a/ci/test.yml b/ci/test.yml new file mode 100644 index 0000000000..d8549d62c1 --- /dev/null +++ b/ci/test.yml @@ -0,0 +1,75 @@ +image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment + +# Core + +test core unix unit: + stage: test + dependencies: + - build core unix frozen + script: + - cd core + - pipenv run make test + +test core unix device: + stage: test + dependencies: + - build core unix frozen + script: + - cd core + - pipenv run make test_emu + +test core unix monero: + stage: test + dependencies: + - build core unix frozen + script: + - cd core + - pipenv run make test_emu_monero + + +# Crypto + +test crypto: + stage: test + dependencies: + - build crypto + script: + - cd crypto + - ./tests/aestst + - ./tests/test_check + - CK_TIMEOUT_MULTIPLIER=20 valgrind -q --error-exitcode=1 ./tests/test_check + - ./tests/test_openssl 1000 + - ITERS=10 pipenv run pytest tests + + +# Legacy + +test legacy emu: + stage: test + dependencies: + - build legacy emu + variables: + EMULATOR: "1" + script: + - cd legacy + - pipenv run script/test + + +# Python + +test python: + stage: test + script: + - cd python + - pipenv run tox + + +# Storage + +test storage: + stage: test + dependencies: [] + script: + - cd storage/tests + - pipenv run make build + - pipenv run make tests_all