Skip to content

Commit

Permalink
Adapt ci-workflow to reusable and guideline enforcer
Browse files Browse the repository at this point in the history
  • Loading branch information
cedelavergne-ledger committed Mar 26, 2024
1 parent d794787 commit c844312
Showing 1 changed file with 5 additions and 69 deletions.
74 changes: 5 additions & 69 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Tests
name: Tests (Speculos and Zemu)

on:
workflow_dispatch:
Expand Down Expand Up @@ -41,16 +41,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Test
run: |
id
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v3

- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- name: Install additional tools
run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev

- name: Install NodeJS
uses: actions/setup-node@v3
Expand All @@ -72,7 +67,7 @@ jobs:
path: tmp/

- name: Gather elfs
run: cp `find tmp/e2e_zemu_elfs/ -name "*.elf"` tests/zemu/elfs/
run: cp tmp/e2e_zemu_elfs/*.elf tests/zemu/elfs/

- name: Run zemu tests
run: cd tests/zemu/ && yarn test
Expand Down Expand Up @@ -128,7 +123,7 @@ jobs:
path: tmp/

- name: Gather elfs
run: cp `find tmp/e2e_speculos_elfs/ -name "*.elf"` tests/speculos/elfs/
run: cp tmp/e2e_speculos_elfs/*.elf tests/speculos/elfs/

- name: Install dependencies
run: |
Expand All @@ -140,62 +135,3 @@ jobs:
run: |
cd tests/speculos
pytest --model ${{ matrix.model }} --path ./elfs/${{ matrix.model }}.elf --display headless
# =====================================================
# RAGGER TESTS
# =====================================================

build_ragger_elfs:
name: Build app for Ragger tests
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
upload_app_binaries_artifact: "ragger_elfs"
flags: "DEBUG=1 CAL_TEST_KEY=1 DOMAIN_NAME_TEST_KEY=1 SET_PLUGIN_TEST_KEY=1 NFT_TEST_KEY=1"

jobs-ragger-tests:
name: Run Ragger tests
needs: build_ragger_elfs
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
download_app_binaries_artifact: "ragger_elfs"

# =====================================================
# STATIC ANALYSIS
# =====================================================

# Static analysis on the main ETH chain is covered by the guidelines enforcer
scan-build:
name: Clang Static Analyzer on altcoin
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
strategy:
fail-fast: false
matrix:
device: ["nanos", "nanos2", "nanox", "stax"]

steps:
- name: Clone
uses: actions/checkout@v3
with:
submodules: recursive

- name: Build with Clang Static Analyzer
run: |
eval "BOLOS_SDK=\$$(echo ${{ matrix.device }} | tr [:lower:] [:upper:])_SDK" && \
echo "BOLOS_SDK value will be: ${BOLOS_SDK}" && \
make -j ENABLE_SDK_WERROR=1 BOLOS_SDK=${BOLOS_SDK} CHAIN=polygon scan-build
- uses: actions/upload-artifact@v3
if: failure()
with:
name: scan-build
path: scan-build

- name: Upload scan result
if: failure()
uses: actions/upload-artifact@v3
with:
name: scan-build
path: scan-build

0 comments on commit c844312

Please sign in to comment.