Build and Test with last nightly #591
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test with last nightly everyday @12PM | |
on: | |
workflow_dispatch: | |
# schedule: | |
# * is a special character in YAML so you have to quote this string | |
# - cron: '0 12 * * *' | |
jobs: | |
call_get_app_metadata: | |
# This job digests inputs and repository metadata provided by the `ledger_app.toml` manifest | |
# file, in order to output relevant directories, compatible devices, and other variables needed | |
# by following jobs. | |
name: Retrieve application metadata | |
uses: LedgerHQ/ledger-app-workflows/.github/workflows/_get_app_metadata.yml@v1 | |
with: | |
app_repository: LedgerHQ/app-boilerplate-rust | |
build_with_last_nightly: | |
needs: call_get_app_metadata | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest | |
strategy: | |
matrix: | |
device: ${{ fromJSON(needs.call_get_app_metadata.outputs.compatible_devices) }} | |
steps: | |
- name: install nightly toolchain | |
run: | | |
rustup toolchain install nightly | |
rustup component add rust-src --toolchain nightly | |
export RUST_NIGHTLY=nightly | |
cargo ledger setup | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
repository: LedgerHQ/app-boilerplate-rust | |
path: app | |
- name: Patch Cargo.toml to use y333/nightly_support for ledger_device_sdk and include_gif crate | |
run: | | |
cd app/${{ needs.call_get_app_metadata.outputs.build_directory }} | |
sed -i 's|ledger_device_sdk = ".*"|ledger_device_sdk = { git = "https://github.com/LedgerHQ/ledger-device-rust-sdk.git", branch = "y333/nightly_support" }|' Cargo.toml | |
sed -i 's|include_gif = ".*"|include_gif = { git = "https://github.com/LedgerHQ/ledger-device-rust-sdk.git", branch = "y333/nightly_support" }|' Cargo.toml | |
echo "Display patched Cargo.toml:" | |
cat Cargo.toml | |
- name: Build | |
run: | | |
cd app/${{ needs.call_get_app_metadata.outputs.build_directory }} | |
cargo update include_gif | |
cargo update ledger_secure_sdk_sys | |
cargo update ledger_device_sdk | |
cargo ledger build ${{ matrix.device }} | |
ELF_NAME=$(cargo metadata --manifest-path ./Cargo.toml --no-deps --format-version 1 | jq -r '.packages[] | select(.metadata.ledger != null) | .name') | |
echo "ELF_NAME=$ELF_NAME" >> $GITHUB_ENV | |
echo "Built ELF name is $ELF_NAME" | |
- name: Upload binary artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "app_binaries_${{ matrix.device }}" | |
path: app/${{ needs.call_get_app_metadata.outputs.build_directory }}/${{ matrix.device }}/release/${{ env.ELF_NAME }} | |
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 | |
# app_branch_name: "main" | |
# download_app_binaries_artifact: "app_elf_binaries" |