Skip to content

Commit

Permalink
Add reusable workflow for building
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPxt committed Jan 28, 2025
1 parent bf2749f commit 8002a78
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
- id: get-user
run: echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT

build_application:
name: Build application using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
upload_app_binaries_artifact: "compiled_app_binaries"

build:
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
steps:
Expand Down Expand Up @@ -48,7 +54,7 @@ jobs:
run: mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make
- run: make cpp_test

build_ledger:
build_nanoS:
needs: configure
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
container:
Expand All @@ -71,14 +77,14 @@ jobs:
echo "size=$(python3 deps/ledger-zxlib/scripts/getSize.py s)" >> $GITHUB_OUTPUT
size_nano_s:
needs: build_ledger
needs: build_nanoS
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
env:
NANOS_LIMIT_SIZE: 136
steps:
- run: |
echo "LNS app size: ${{needs.build_ledger.outputs.size}} KiB"
[ ${{needs.build_ledger.outputs.size}} -le $NANOS_LIMIT_SIZE ]
echo "LNS app size: ${{needs.build_nanoS.outputs.size}} KiB"
[ ${{needs.build_nanoS.outputs.size}} -le $NANOS_LIMIT_SIZE ]
test_zemu:
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
Expand Down Expand Up @@ -125,7 +131,7 @@ jobs:
path: tests_zemu/snapshots-tmp/

build_package_nanos:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
container:
Expand Down Expand Up @@ -161,7 +167,7 @@ jobs:
prerelease: false

build_package_nanosp:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
container:
Expand Down Expand Up @@ -197,7 +203,7 @@ jobs:
prerelease: false

build_package_stax:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: zondax-runners
container:
Expand Down Expand Up @@ -233,7 +239,7 @@ jobs:
prerelease: false

build_package_flex:
needs: [configure, build, build_ledger, test_zemu]
needs: [configure, build, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
container:
Expand Down

0 comments on commit 8002a78

Please sign in to comment.