From 09c07bb31e130926ccff3e3128ffe8bd7e48d162 Mon Sep 17 00:00:00 2001 From: GroM Date: Wed, 17 Jan 2024 14:53:35 +0100 Subject: [PATCH 1/6] added new workflow to test updated nightly --- .github/workflows/build_with_nightly.yml | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build_with_nightly.yml diff --git a/.github/workflows/build_with_nightly.yml b/.github/workflows/build_with_nightly.yml new file mode 100644 index 00000000..199371d6 --- /dev/null +++ b/.github/workflows/build_with_nightly.yml @@ -0,0 +1,35 @@ +name: Build with last nightly everyday @ 4PM + +on: + pull_request: + workflow_dispatch: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '00 12 * * *' + +jobs: + build_with_last_nightly: + runs-on: ubuntu-latest + container: + image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest + strategy: + matrix: + target: ["nanos", "nanox", "nanosplus"] + steps: + - name: update nightly toolchain + run: | + rustup update nightly + rustup default nightly + rustup component add rust-src --toolchain nightly + cargo ledger setup + + - name: Checkout Code + uses: actions/checkout@v4 + with: + repository: LedgerHQ/app-boilerplate-rust + path: app-boilerplate + + - name: Build + run: | + cd app-boilerplate + cargo ledger build ${{ matrix.target }} \ No newline at end of file From 46053662dc96d0f65171debba71db485373d3d9e Mon Sep 17 00:00:00 2001 From: GroM Date: Wed, 17 Jan 2024 16:26:31 +0100 Subject: [PATCH 2/6] add ragger tests after building --- .../workflows/build_with_current_nightly.yml | 54 +++++++++++++++++++ .github/workflows/build_with_nightly.yml | 35 ------------ 2 files changed, 54 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/build_with_current_nightly.yml delete mode 100644 .github/workflows/build_with_nightly.yml diff --git a/.github/workflows/build_with_current_nightly.yml b/.github/workflows/build_with_current_nightly.yml new file mode 100644 index 00000000..b7ca8d12 --- /dev/null +++ b/.github/workflows/build_with_current_nightly.yml @@ -0,0 +1,54 @@ +name: Build and Test with last nightly everyday @12PM + +on: + pull_request: + workflow_dispatch: + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '00 12 * * *' + +jobs: + build_with_last_nightly: + runs-on: ubuntu-latest + container: + image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest + strategy: + matrix: + device: ["nanos", "nanox", "nanosplus"] + steps: + - name: update nightly toolchain + run: | + rustup update nightly + rustup default nightly + rustup component add rust-src --toolchain nightly + cargo ledger setup + + - name: Checkout Code + uses: actions/checkout@v4 + with: + repository: LedgerHQ/app-boilerplate-rust + path: app-boilerplate + + - name: Build + run: | + BUILD_DEVICE_NAME="$(echo ${{ matrix.device }}" + BIN_DIR_NAME="$(echo ${{ matrix.device }} | sed 's/nanosplus/nanos2/')" + cd app-boilerplate + cargo ledger build ${{ matrix.device }} + mkdir -p build/${BIN_DIR_NAME}/bin + mv ./target/${BUILD_DEVICE_NAME}/release/app-boilerplate-rust ./build/${BIN_DIR_NAME}/bin/app.elf + + - name: Upload binary artifacts + uses: actions/upload-artifact@v3 + with: + name: "app_elf_binaries" + path: ./build/* + if-no-files-found: error + + ragger_tests: + name: Run ragger tests using the reusable workflow + needs: build_with_last_nightly + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 + with: + app_repository: LedgerHQ/app-boilerplate-rust + download_app_binaries_artifact: "app_elf_binaries" \ No newline at end of file diff --git a/.github/workflows/build_with_nightly.yml b/.github/workflows/build_with_nightly.yml deleted file mode 100644 index 199371d6..00000000 --- a/.github/workflows/build_with_nightly.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build with last nightly everyday @ 4PM - -on: - pull_request: - workflow_dispatch: - schedule: - # * is a special character in YAML so you have to quote this string - - cron: '00 12 * * *' - -jobs: - build_with_last_nightly: - runs-on: ubuntu-latest - container: - image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest - strategy: - matrix: - target: ["nanos", "nanox", "nanosplus"] - steps: - - name: update nightly toolchain - run: | - rustup update nightly - rustup default nightly - rustup component add rust-src --toolchain nightly - cargo ledger setup - - - name: Checkout Code - uses: actions/checkout@v4 - with: - repository: LedgerHQ/app-boilerplate-rust - path: app-boilerplate - - - name: Build - run: | - cd app-boilerplate - cargo ledger build ${{ matrix.target }} \ No newline at end of file From 27e95ac60e73f4259dae7357bce146d00700dd09 Mon Sep 17 00:00:00 2001 From: GroM Date: Wed, 17 Jan 2024 17:10:09 +0100 Subject: [PATCH 3/6] fix typo in workflow --- .github/workflows/build_with_current_nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_with_current_nightly.yml b/.github/workflows/build_with_current_nightly.yml index b7ca8d12..30bacf19 100644 --- a/.github/workflows/build_with_current_nightly.yml +++ b/.github/workflows/build_with_current_nightly.yml @@ -31,7 +31,7 @@ jobs: - name: Build run: | - BUILD_DEVICE_NAME="$(echo ${{ matrix.device }}" + BUILD_DEVICE_NAME="$(echo ${{ matrix.device }})" BIN_DIR_NAME="$(echo ${{ matrix.device }} | sed 's/nanosplus/nanos2/')" cd app-boilerplate cargo ledger build ${{ matrix.device }} From 6e65dd17f8a4b5c3689cc1cac33fa6f1f156c630 Mon Sep 17 00:00:00 2001 From: GroM Date: Wed, 17 Jan 2024 17:21:28 +0100 Subject: [PATCH 4/6] fix binary artifacts path --- .github/workflows/build_with_current_nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_with_current_nightly.yml b/.github/workflows/build_with_current_nightly.yml index 30bacf19..bd3fed85 100644 --- a/.github/workflows/build_with_current_nightly.yml +++ b/.github/workflows/build_with_current_nightly.yml @@ -42,7 +42,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: "app_elf_binaries" - path: ./build/* + path: app-boilerplate/build/* if-no-files-found: error ragger_tests: From 381825e9dab6cd50b8ba16d94c33ec6224cf3ad6 Mon Sep 17 00:00:00 2001 From: GroM Date: Wed, 17 Jan 2024 17:33:46 +0100 Subject: [PATCH 5/6] add branch name --- .github/workflows/build_with_current_nightly.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_with_current_nightly.yml b/.github/workflows/build_with_current_nightly.yml index bd3fed85..13d8eb60 100644 --- a/.github/workflows/build_with_current_nightly.yml +++ b/.github/workflows/build_with_current_nightly.yml @@ -51,4 +51,5 @@ jobs: uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 with: app_repository: LedgerHQ/app-boilerplate-rust + app_branch_name: "main" download_app_binaries_artifact: "app_elf_binaries" \ No newline at end of file From 8e311e26044af109ccdcebc59afddb9803e01ff5 Mon Sep 17 00:00:00 2001 From: GroM Date: Wed, 17 Jan 2024 17:56:47 +0100 Subject: [PATCH 6/6] do not test last nightly on PR --- .github/workflows/build_with_current_nightly.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_with_current_nightly.yml b/.github/workflows/build_with_current_nightly.yml index 13d8eb60..f9175c30 100644 --- a/.github/workflows/build_with_current_nightly.yml +++ b/.github/workflows/build_with_current_nightly.yml @@ -1,11 +1,10 @@ name: Build and Test with last nightly everyday @12PM on: - pull_request: workflow_dispatch: schedule: # * is a special character in YAML so you have to quote this string - - cron: '00 12 * * *' + - cron: '0 12 * * *' jobs: build_with_last_nightly: