Skip to content

Commit

Permalink
add workflow to build all Rust apps for every PR
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Jan 25, 2024
1 parent 8211c9d commit 6e2ce74
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/build_all_apps.yml
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+"

0 comments on commit 6e2ce74

Please sign in to comment.