1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-20 21:38:26 +00:00
trezor-firmware/ci/build.yml

275 lines
7.1 KiB
YAML
Raw Normal View History

image: registry.gitlab.com/satoshilabs/trezor/trezor-firmware/environment
variables:
SDL_VIDEODRIVER: "dummy"
XDG_RUNTIME_DIR: "/var/tmp"
.only_changes_core: &only_changes_core
only:
changes:
- ci/**/*
- common/**/*
- core/**/*
- crypto/**/*
- python/**/*
- storage/**/*
- tests/**/*
- tools/**/*
- vendor/**/*
2020-01-29 09:09:32 +00:00
- Pipfile.lock
.only_changes_legacy: &only_changes_legacy
only:
changes:
- ci/**/*
- common/**/*
- crypto/**/*
- legacy/**/*
- python/**/*
- storage/**/*
- tests/**/*
- tools/**/*
- vendor/**/*
2020-01-29 09:09:32 +00:00
- Pipfile.lock
# Core
core fw regular build:
stage: build
<<: *only_changes_core
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
- cd ..
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
- cp core/build/firmware/firmware.bin trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-fw-regular-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
2019-11-05 09:23:11 +00:00
core fw regular debug build:
stage: build
<<: *only_changes_core
script:
- cd core
- PYOPT=0 pipenv run make build_firmware
- cd ..
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
- cp core/build/firmware/firmware.bin trezor-fw-regular-debug-$VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-fw-regular-debug-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
core fw btconly build:
2019-08-22 18:18:44 +00:00
stage: build
<<: *only_changes_core
2019-08-22 18:18:44 +00:00
variables:
BITCOIN_ONLY: "1"
script:
- cd core
- pipenv run make build_firmware
- mv build/firmware/firmware.bin build/firmware/firmware-bitcoinonly.bin
- cd ..
- pipenv run ./tools/check-bitcoin-only core/build/firmware/firmware-bitcoinonly.bin
- export VERSION=$(./tools/version.sh core/embed/firmware/version.h)
- cp core/build/firmware/firmware-bitcoinonly.bin trezor-fw-btconly-$VERSION-$CI_COMMIT_SHORT_SHA.bin
2019-08-22 18:18:44 +00:00
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-fw-btconly-*.*.*-$CI_COMMIT_SHORT_SHA.bin
2019-08-22 18:18:44 +00:00
expire_in: 1 week
core unix regular build:
stage: build
<<: *only_changes_core
script:
- cd core
- pipenv run make build_unix
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- core/build/unix/micropython
- core/src/trezor/res/resources.py
expire_in: 1 week
core unix frozen regular build:
stage: build
<<: *only_changes_core
script:
- cd core
- pipenv run make build_unix_frozen
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- core/build/unix/micropython
expire_in: 1 week
core unix frozen btconly debug build:
2019-08-22 18:18:44 +00:00
stage: build
<<: *only_changes_core
2019-08-22 18:18:44 +00:00
variables:
PYOPT: "0"
2019-08-22 18:18:44 +00:00
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
expire_in: 1 week
2019-08-22 18:18:44 +00:00
core unix frozen debug build:
stage: build
<<: *only_changes_core
variables:
PYOPT: "0"
script:
- cd core
- pipenv run make build_unix_frozen
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
untracked: true
expire_in: 1 week
build core unix frozen regular darwin:
stage: build
tags:
- darwin
when: manual
script:
- . $HOME/.nix-profile/etc/profile.d/nix.sh
- nix-shell --run "cd core && make build_unix_frozen"
- mkdir -p TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/{MacOS,libs}
- cp -v core/build/unix/micropython TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
- dylibbundler -of -b -i /usr/lib/system -d TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/libs -x TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA
- mv TrezorEmu-$CI_COMMIT_SHORT_SHA.app trezor-emu-regular-macos-$VERSION-$CI_COMMIT_SHORT_SHA.app
allow_failure: true
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-emu-regular-macos-$VERSION-$CI_COMMIT_SHORT_SHA.app
expire_in: 1 week
# Crypto
crypto build:
stage: build
only:
changes:
- ci/**/*
- crypto/**/*
script:
- cd crypto
- pipenv run make
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- crypto/tests/aestst
- crypto/tests/libtrezor-crypto.so
- crypto/tests/test_check
- crypto/tests/test_openssl
expire_in: 1 week
# Legacy
legacy fw regular build:
stage: build
<<: *only_changes_legacy
variables:
MEMORY_PROTECT: "0"
script:
- cd legacy
- pipenv run script/cibuild
- pipenv run make -C demo
- cd ..
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
- mv legacy/firmware/trezor.bin trezor-fw-regular-$VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-fw-regular-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
legacy fw debug build:
stage: build
<<: *only_changes_legacy
variables:
DEBUG_LINK: "1"
MEMORY_PROTECT: "0"
script:
- cd legacy
- pipenv run script/cibuild
- cd ..
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
- mv legacy/firmware/trezor.bin trezor-fw-regular-debug-$VERSION-$CI_COMMIT_SHORT_SHA.bin
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- trezor-fw-regular-debug-*.*.*-$CI_COMMIT_SHORT_SHA.bin
expire_in: 1 week
legacy fw btconly build:
stage: build
<<: *only_changes_legacy
variables:
BITCOIN_ONLY: "1"
MEMORY_PROTECT: "0"
script:
- cd legacy
- pipenv run script/cibuild
- mv firmware/trezor.bin firmware/trezor-bitcoinonly.bin
- cd ..
- pipenv run ./tools/check-bitcoin-only legacy/firmware/trezor-bitcoinonly.bin
- export VERSION=$(./tools/version.sh legacy/firmware/version.h)
- mv legacy/firmware/trezor-bitcoinonly.bin trezor-fw-btconly-$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
<<: *only_changes_legacy
variables:
DEBUG_LINK: "1"
EMULATOR: "1"
script:
- cd legacy
- pipenv run script/cibuild
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- legacy/firmware/trezor.elf
expire_in: 1 week
legacy emu btconly build:
stage: build
<<: *only_changes_legacy
variables:
BITCOIN_ONLY: "1"
DEBUG_LINK: "1"
EMULATOR: "1"
script:
- cd legacy
- pipenv run script/cibuild
2019-08-22 18:18:44 +00:00
- 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 week