1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-28 18:38:39 +00:00

script: Add Scripts To Rule Them All

This commit is contained in:
Saleem Rashid 2017-12-17 16:00:32 +00:00 committed by Pavol Rusnak
parent 17340c2396
commit 923d5f7555
7 changed files with 73 additions and 6 deletions

3
.gitmodules vendored
View File

@ -13,3 +13,6 @@
[submodule "vendor/nanopb"]
path = vendor/nanopb
url = https://github.com/nanopb/nanopb.git
[submodule "python-trezor"]
path = vendor/python-trezor
url = https://github.com/trezor/python-trezor.git

View File

@ -26,13 +26,8 @@ install:
- pip2 install --user "protobuf==${PROTOBUF_VERSION}"
script:
- make -C vendor/libopencm3 lib/stm32/f2
- make -C vendor/nanopb/generator/proto
- make
- script/cibuild
- make -C bootloader
- make -C fastflash
- make -C firmware/protob
- make -C firmware
- make -C demo
notifications:

10
script/bootstrap Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# script/bootstrap: Resolve all dependencies that the application requires to
# run.
set -e
cd "$(dirname "$0")/.."
git submodule update --init

25
script/cibuild Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# script/cibuild: Setup environment for CI to run tests. This is primarily
# designed to run on the continuous integration server.
set -e
cd "$(dirname "$0")/.."
if [ "$EMULATOR" = 1 ]; then
make -C emulator
else
make -C vendor/libopencm3 lib/stm32/f2
fi
make
if [ "$FASTFLASH" = 1 ]; then
make -C fastflash
fi
make -C vendor/nanopb/generator/proto
make -C firmware/protob
make -C firmware

13
script/setup Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# script/setup: Set up application for the first time after cloning, or set it
# back to the initial first unused state.
set -e
cd "$(dirname "$0")/.."
script/bootstrap
git clean -fdX
git submodule foreach git clean -fdX

20
script/test Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
# script/test: Run test suite for application.
set -e
cd "$(dirname "$0")/.."
# Kill jobs on exit
trap "exit" INT TERM
trap "kill 0" EXIT
if [ "$EMULATOR" = 1 ]; then
firmware/trezor.elf &
fi
TREZOR_TRANSPORT_V1=1 pytest "vendor/python-trezor/tests/device_tests" &
# Wait for either job to exit and kill the other
wait -n

1
vendor/python-trezor vendored Submodule

@ -0,0 +1 @@
Subproject commit 90c49e3386ee9391c2a57e2ca0a40f8a909a47cc