Skip to content

Commit

Permalink
Merge pull request #20 from ergoplatform/build-ci
Browse files Browse the repository at this point in the history
Update build CI job
  • Loading branch information
arobsn authored Nov 4, 2024
2 parents 709af7b + 7a36bb4 commit 75a4614
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 45 deletions.
63 changes: 19 additions & 44 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,11 @@ name: Compilation & tests
on: [push, pull_request]

jobs:
job_build_nano_debug:
name: Build application for NanoS+, X, Stax, Flex
runs-on: ubuntu-latest
strategy:
matrix:
include:
- SDK: "$NANOX_SDK"
artifact: ergo-app-debug-nanox
- SDK: "$NANOSP_SDK"
artifact: ergo-app-debug-nanosp
- SDK: "$STAX_SDK"
artifact: ergo-app-debug-stax
- SDK: "$FLEX_SDK"
artifact: ergo-app-debug-flex

container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest

steps:
- name: Clone
uses: actions/checkout@v4

- name: Build
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
make BOLOS_SDK=${{ matrix.SDK }} DEBUG=1
- name: Upload app binary
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: bin
job_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"

job_unit_test:
name: Unit tests
Expand Down Expand Up @@ -122,7 +95,7 @@ jobs:
export BOLOS_SDK=${{ matrix.SDK }}
make clean
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
- name: Upload scan result
uses: actions/upload-artifact@v4
if: failure()
Expand All @@ -133,15 +106,17 @@ jobs:
job_test:
name: Functional Tests

strategy:
strategy:
matrix:
include:
- model: nanox
- model: nanosp
#- model: stax
#- model: flex

needs: job_build_nano_debug
- model:
id: nanox
dir: nanox
- model:
id: nanosp
dir: nanos2

needs: job_build_application
runs-on: ubuntu-latest

container:
Expand All @@ -158,7 +133,7 @@ jobs:
- name: Download app binary
uses: actions/download-artifact@v4
with:
name: ergo-app-debug-${{matrix.model}}
name: compiled_app_binaries
path: bin

- name: Run test
Expand All @@ -167,13 +142,13 @@ jobs:
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -qy nodejs
export SEED=`cat tests/seed.txt`
nohup bash -c "python /speculos/speculos.py bin/app.elf --apdu-port 9999 --api-port 5000 --display headless --model=${{ matrix.model }} --seed \"${SEED}\"" > speculos.log 2<&1 &
nohup bash -c "python /speculos/speculos.py bin/${{ matrix.model.dir }}/bin/app.elf --apdu-port 9999 --api-port 5000 --display headless --model=${{ matrix.model.id }} --seed \"${SEED}\"" > speculos.log 2<&1 &
cd tests && npm install
until `nc -w5 -z -v 127.0.0.1 9999`; do sleep 1; done;
npm --model=${{matrix.model}} --port=5000 run test
npm --model=${{matrix.model.id}} --port=5000 run test
- name: Upload Speculos log
uses: actions/upload-artifact@v4
with:
name: speculos-${{matrix.model}}-log
name: speculos-${{matrix.model.id}}-log
path: speculos.log
2 changes: 1 addition & 1 deletion tests/basic-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("Basic Tests", function () {
major: makefile.versionMajor,
minor: makefile.versionMinor,
patch: makefile.versionPatch,
flags: { isDebug: true }
flags: { isDebug: false }
});
});

Expand Down

0 comments on commit 75a4614

Please sign in to comment.