From 7e8ed2ee24e172cc1039d4dec88af943b08a79f2 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 3 Dec 2024 19:49:24 +0100 Subject: [PATCH 1/2] ci: add build-docker.sh job [no changelog] --- .github/workflows/common.yml | 33 +++++++++++++++++++++++++++++++++ build-docker.sh | 4 +--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 54ff2c22fa..b9f5b7c85c 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -120,3 +120,36 @@ jobs: - run: unset PYTEST_TIMEOUT - run: nix-shell --run "poetry run make -C storage/tests build" - run: nix-shell --run "poetry run make -C storage/tests tests_all" + + docker_build: + name: Firmware docker build + # scheduled, manual runs, PRs for release branches + if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'release/') + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # model: [T1B1, T2T1, T2B1, T3B1, T3T1] # TODO update exprs below + model: ["1", "T", "R", T3B1, T3T1] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: git checkout ${{ github.head_ref || github.ref_name }} + - run: ./build-docker.sh ${{ matrix.model == '1' && '--skip-core' || '--skip-legacy' }} --models ${{ matrix.model }} ${{ github.head_ref || github.ref_name }} + - name: Show fingerprints + run: | + for file in build/*/*/*.fingerprint; do + if [ -f "$file" ]; then + origfile="${file%.fingerprint}" + fingerprint=$(tr -d '\n' < $file) + echo "\`$fingerprint\` $origfile" >> $GITHUB_STEP_SUMMARY + fi + done + cat $GITHUB_STEP_SUMMARY + - uses: actions/upload-artifact@v4 + with: + name: reproducible-${{ matrix.model }} + path: | + build/*/*/*.bin + retention-days: 7 diff --git a/build-docker.sh b/build-docker.sh index a5598a4f16..1df5cf5f97 100755 --- a/build-docker.sh +++ b/build-docker.sh @@ -227,7 +227,7 @@ cat <> "$SCRIPT_NAME" git fetch origin "$COMMIT_HASH" git checkout "$COMMIT_HASH" git submodule update --init --recursive - poetry install + poetry install -v --no-ansi --no-interaction cd core/embed/rust cargo fetch @@ -307,7 +307,6 @@ EOF $DOCKER run \ --network=host \ - -it \ --rm \ -v "$DIR:/local" \ -v "$DIR/build/core$DIRSUFFIX":/build:z \ @@ -356,7 +355,6 @@ EOF $DOCKER run \ --network=host \ - -it \ --rm \ -v "$DIR:/local" \ -v "$DIR/build/legacy$DIRSUFFIX":/build:z \ From e79988e04a404f8e56891358c00dccfc003a51f1 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 3 Dec 2024 22:12:17 +0100 Subject: [PATCH 2/2] DO NOT MERGE: test pull_request trigger --- .github/workflows/common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index b9f5b7c85c..ea0248df1f 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -124,7 +124,7 @@ jobs: docker_build: name: Firmware docker build # scheduled, manual runs, PRs for release branches - if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'release/') + if: github.event_name != 'pull_request' || startsWith(github.head_ref, 'mmilata/') runs-on: ubuntu-latest strategy: fail-fast: false