-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow to build all Rust apps for every PR
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Build all Rust apps | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
sdk_branch: | ||
type: string | ||
required: false | ||
default: '' | ||
pull_request: | ||
|
||
env: | ||
repo_list: ' | ||
{\"repo_name\":[ | ||
\"app-mobilecoin\", | ||
\"app-radix-babylon\", | ||
]} | ||
' | ||
|
||
jobs: | ||
prepare-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- id: set-matrix | ||
run: echo "matrix=${{ env.repo_list }}" >> $GITHUB_OUTPUT | ||
|
||
test-build: | ||
name: Build for all targets | ||
needs: [prepare-matrix] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
${{ fromJSON(needs.prepare-matrix.outputs.matrix) }} | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest | ||
steps: | ||
- name: Clone App | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: LedgerHQ/${{ matrix.repo_name }} | ||
submodules: true | ||
ref: 'develop' | ||
path: ${{ matrix.repo_name }} | ||
|
||
- name: Build Path and Targets | ||
run: | | ||
cargo +$RUST_STABLE install toml-cli | ||
cd ${{ matrix.repo_name }} | ||
build_path=$(toml get ledger_app.toml app.build_directory) | ||
echo "build_path=$build_path" >> $GITHUB_ENV | ||
for device in nanos "nanos+" nanox; do | ||
build_device=$(toml get ledger_app.toml app.devices | grep -o "\"$device\"" | sed 's/"/'/g | sed 's/+/plus/') | ||
if [ -n "$build_device" ]; then | ||
echo "build_${build_device}=true" >> $GITHUB_ENV | ||
fi | ||
done | ||
- name: Build NanoS | ||
if: ${{ env.build_nanos == 'true' }} | ||
run: | | ||
cd ${{ matrix.repo_name }} | ||
cd ${{ env.build_path }} | ||
echo "Build for Nano S" | ||
- name: Build NanoX | ||
if: ${{ env.build_nanox == 'true' }} | ||
run: | | ||
cd ${{ matrix.repo_name }} | ||
cd ${{ env.build_path }} | ||
echo "Build for Nano X" | ||
- name: Build NanoS+ | ||
if: ${{ env.build_nanosplus == 'true' }} | ||
run: | | ||
cd ${{ matrix.repo_name }} | ||
cd ${{ env.build_path }} | ||
echo "Build for Nano S+" |