This repository has been archived by the owner on May 17, 2024. It is now read-only.
[auto]: add PR template #64
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
name: Compilation & tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- master | |
- develop | |
pull_request: | |
jobs: | |
job_build_release_plugin: | |
name: Build release plugin | |
strategy: | |
matrix: | |
include: | |
- sdk: "$NANOS_SDK" | |
name: "nanos" | |
- sdk: "$NANOX_SDK" | |
name: "nanox" | |
- sdk: "$NANOSP_SDK" | |
name: "nanosp" | |
- sdk: "$STAX_SDK" | |
name: "stax" | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest | |
steps: | |
- name: Clone | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build | |
run: | | |
make BOLOS_SDK=${{ matrix.sdk }} -j | |
job_scan_build: | |
name: Clang Static Analyzer | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build with Clang Static Analyzer | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: scan-build | |
path: scan-build | |
job_coverity_scan: | |
name: Coverity Scan | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-scanner:latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build with cov-build | |
run: | | |
git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
cov-build --dir cov-int make default | |
- name: Submit the result to Coverity Scan | |
run: | | |
tar czvf cov-int.tar.gz cov-int | |
curl \ | |
--form token=$TOKEN \ | |
--form email=$EMAIL \ | |
--form [email protected] \ | |
--form version=master \ | |
--form description="Ledger NFT Plugin" \ | |
https://scan.coverity.com/builds?project=LedgerHQ%2Fapp-plugin-ledgernft | |
env: | |
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }} | |
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} | |
job_build_debug_plugin: | |
name: Build debug plugin | |
strategy: | |
matrix: | |
include: | |
- sdk: "$NANOS_SDK" | |
name: "nanos" | |
- sdk: "$NANOX_SDK" | |
name: "nanox" | |
- sdk: "$NANOSP_SDK" | |
name: "nanosp" | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest | |
steps: | |
- name: Clone | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build | |
run: | | |
make clean | |
make -j DEBUG=1 BOLOS_SDK=${{ matrix.sdk }} | |
- name: Rename binary | |
run: | | |
mv bin/app.elf plugin_${{ matrix.name }}.elf | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: plugin_${{ matrix.name }}.elf | |
job_build_debug_app: | |
name: Build debug Ethereum app | |
strategy: | |
matrix: | |
include: | |
- sdk: "$NANOS_SDK" | |
name: "nanos" | |
- sdk: "$NANOX_SDK" | |
name: "nanox" | |
- sdk: "$NANOSP_SDK" | |
name: "nanosp" | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest | |
steps: | |
- name: Checkout app-ethereum | |
uses: actions/checkout@v3 | |
with: | |
repository: LedgerHQ/app-ethereum | |
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }} | |
submodules: recursive | |
- name: Build | |
run: | | |
make clean | |
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=${{ matrix.sdk }} CHAIN=ethereum ALLOW_DATA=1 | |
- name: Rename binary | |
run: | | |
mv bin/app.elf ethereum_${{ matrix.name }}.elf | |
- name: Upload binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: binaries | |
path: ethereum_${{ matrix.name }}.elf | |
jobs-e2e-tests: | |
name: E2E Tests | |
needs: [job_build_debug_plugin, job_build_debug_app] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Download built binaries | |
uses: actions/download-artifact@v3 | |
with: | |
name: binaries | |
path: tests/elfs/ | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.19.0" | |
- name: Install yarn | |
run: | | |
npm install -g yarn | |
- name: Install JS deps | |
run: | | |
cd tests && yarn install | |
- name: Run Zemu tests | |
run: | | |
cd tests && docker pull zondax/builder-zemu@sha256:8d7b06cedf2d018b9464f4af4b7a8357c3fbb180f3ab153f8cb8f138defb22a4 && yarn test |