Skip to content

Tests: add test for all commands #350

Tests: add test for all commands

Tests: add test for all commands #350

Workflow file for this run

name: Build & test apps
# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation.
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary.
#
# While this workflow is optional, having functional testing on your application is mandatory and this workflow and
# tooling environment is meant to be easy to use and adapt after forking your application
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
build_app:
name: Build application
strategy:
matrix:
device: [nanos, nanosp, nanox, stax]
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:3.5.0
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
DEVICE_SDK="$(echo ${{ matrix.device }} | tr a-z A-Z)_SDK"
bash -c "make -C app BOLOS_SDK=\$${DEVICE_SDK}"
tar -C app/bin -czf app_${{ matrix.device }}.tgz .
bash -c "make -C app BOLOS_SDK=\$${DEVICE_SDK} DEBUG=1"
tar -C app/bin -czf app_${{ matrix.device }}_dbg.tgz .
- name: Upload
uses: actions/upload-artifact@v3
with:
path: app_${{ matrix.device }}.tgz
name: app_${{ matrix.device }}.tgz
- name: Upload (dbg)
uses: actions/upload-artifact@v3
with:
path: app_${{ matrix.device }}_dbg.tgz
name: app_${{ matrix.device }}_dbg.tgz
build_docker_integration_tests:
uses: ./.github/workflows/docker.yml
secrets: inherit
with:
dockerfile: docker/Dockerfile.integration-tests
image_name: integration_tests
build_docker_tezos_ocaml:
uses: ./.github/workflows/docker.yml
secrets: inherit
with:
dockerfile: docker/Dockerfile.ocaml
image_name: tezos_ocaml
integration_tests_basic:
needs: [build_app, build_docker_integration_tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
device: [nanos, nanosp, nanox, stax]
container:
image: ${{ needs.build_docker_integration_tests.outputs.image }}
credentials:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
steps:
- name: Set Git Safe Directory
run: |
git config --global safe.directory "$GITHUB_WORKSPACE"
- name: Checkout
uses: actions/checkout@v3
- name: Download app
uses: actions/download-artifact@v3
with:
name: app_${{ matrix.device }}.tgz
- name: Download app (dbg)
uses: actions/download-artifact@v3
with:
name: app_${{ matrix.device }}_dbg.tgz
- name: Run test
run: |
./tests/integration/run_test_local.sh -F -m ${{ matrix.device }} \
./tests/integration/${{ matrix.device }}
- name: Upload results
uses: actions/upload-artifact@v3
if: always()
with:
name: integration_tests_${{ matrix.device }}.json
path: ./integration_tests.json