From 10d0d8038600c6520a5e5b25371cc8ec1cd75c0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Palmer?= Date: Thu, 11 Jul 2024 13:40:17 +0200 Subject: [PATCH] [flex] add flex on doc and CI --- .github/workflows/build.yml | 12 ++++++------ .github/workflows/codeql_checks.yml | 2 +- README.md | 10 +++++----- ledger_app.toml | 2 +- scripts/test_swap.sh | 4 ++-- tests/integration/test_runtime.sh | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0263b07c3..2f2c5762d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: name: Build application strategy: matrix: - device: [nanos, nanosp, nanox, stax] + device: [nanos, nanosp, nanox, stax, flex] runs-on: ubuntu-latest container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest @@ -58,7 +58,7 @@ jobs: strategy: fail-fast: false matrix: - device: [nanos, nanosp, nanox, stax] + device: [nanos, nanosp, nanox, stax, flex] container: image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest @@ -82,9 +82,9 @@ jobs: - name: Run test run: | - if [ "${{ matrix.device }}" = "stax" ]; then + if [ "${{ matrix.device }}" = "stax" ] || [ "${{ matrix.device }}" = "flex" ]; then ./tests/integration/run_test_local.sh -F -m ${{ matrix.device }} \ - ./tests/integration/${{ matrix.device }} + ./tests/integration/touch else apk add gmp-dev curl jq libsodium-dev git xxd procps python3 -m venv tezos_test_env --system-site-package @@ -99,14 +99,14 @@ jobs: - name: Upload Stax results uses: actions/upload-artifact@v4 - if: always() && matrix.device == 'stax' + if: always() && (matrix.device == 'stax' || matrix.device == 'flex') with: name: integration_tests_${{ matrix.device }}.json path: ./integration_tests.json - name: Upload Nano results uses: actions/upload-artifact@v4 - if: always() && matrix.device != 'stax' + if: always() && (matrix.device != 'stax' && matrix.device != 'flex') with: name: integration_tests_log_${{ matrix.device }} path: ./integration_tests_log diff --git a/.github/workflows/codeql_checks.yml b/.github/workflows/codeql_checks.yml index 83c74be24..0262a3cc8 100644 --- a/.github/workflows/codeql_checks.yml +++ b/.github/workflows/codeql_checks.yml @@ -18,7 +18,7 @@ jobs: name: Analyse strategy: matrix: - sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK" ] + sdk: [ "$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK", "$FLEX_SDK" ] #'cpp' covers C and C++ language: [ 'cpp' ] runs-on: ubuntu-latest diff --git a/README.md b/README.md index 8c814585a..339ce902d 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ Both of these commands take the following arguments: -x : executes the tests with shell tracing (-x) -Basic tests rely on gold-images, rather than OCR. They are stored under [nano/snapshots](./tests/integration/nano/snapshots) and [stax/snapshots](./tests/integration/stax/snapshots). +Basic tests rely on gold-images, rather than OCR. They are stored under [nano/snapshots](./tests/integration/nano/snapshots) and [touch/snapshots](./tests/integration/touch/snapshots). To generate/reset the snapshots, you can do so for individual tests. @@ -171,7 +171,7 @@ You will be requested to press enter to take snapshots in term. **NB** make sure that the screen has updated to the screen you want to snapshot each time. It's also a good idea to re-run the test normally afterwards, to ensure the snapshots have been set correctly. -### STAX +### STAX/FLEX #### Preparation @@ -196,7 +196,7 @@ $ docker exec -it ledger-app-tezos-integration-tests bash; You can run an individual test from the test container. You should see the app progress on the display. ```sh -./tests/integration/stax/.py +./tests/integration/touch/.py ``` #### Setting goldimages @@ -204,7 +204,7 @@ You can run an individual test from the test container. You should see the app p You can reset/set goldimages using the following: ```sh -GOLDEN=1 ./tests/integration/stax/.py +GOLDEN=1 ./tests/integration/touch/.py ``` If you are resetting goldimages for multiple tests, you can also use `export NOQUIT=1` to keep the app @@ -264,4 +264,4 @@ with a new version 1. app/Makefile 2. tests/integration/app_vars.sh 3. tests/integration/nano/utils/app.py -4. the snapshots (nano and stax) +4. the snapshots (nano and touch) diff --git a/ledger_app.toml b/ledger_app.toml index 250760a98..2522c452d 100644 --- a/ledger_app.toml +++ b/ledger_app.toml @@ -1,4 +1,4 @@ [app] build_directory = "./app" sdk = "C" -devices = ["nanos", "nanox", "nanos+", "stax"] +devices = ["nanos", "nanox", "nanos+", "stax", "flex"] diff --git a/scripts/test_swap.sh b/scripts/test_swap.sh index c9937b4f9..c649edc81 100755 --- a/scripts/test_swap.sh +++ b/scripts/test_swap.sh @@ -18,7 +18,7 @@ set -x set -e usage() { - echo "Usage: ./scripts/test_swap.sh {build_app_tezos|build_app_ethereum|build_app_exchange|run_tests|run_tests_all|update} {nanos|nanosp|nanox|stax}" + echo "Usage: ./scripts/test_swap.sh {build_app_tezos|build_app_ethereum|build_app_exchange|run_tests|run_tests_all|update} {nanos|nanosp|nanox|stax|flex}" } _assert_tezos_repo() { @@ -72,7 +72,7 @@ _assert_app_exchange_repo() { set -x } -devices=("nanos" "nanosp" "nanox" "stax") +devices=("nanos" "nanosp" "nanox" "stax" "flex") _assert_device() { set +x diff --git a/tests/integration/test_runtime.sh b/tests/integration/test_runtime.sh index 669ff2cf8..a1d656976 100644 --- a/tests/integration/test_runtime.sh +++ b/tests/integration/test_runtime.sh @@ -556,7 +556,7 @@ usage() { echo " -F means that only failures are stored" >&2 echo " -d tgz specifies that tgz contains the debug app" >&2 echo " -l lim limits the number of tests run to lim" >&2 - echo " -m arch is one of nanos, nanosp, nanox, or stax" >&2 + echo " -m arch is one of nanos, nanosp, nanox, stax or flex" >&2 echo " -t tgz specifies that tgz contains the app" >&2 exit 1 }