|
| 1 | +name: Build and run functional tests using ragger through reusable workflow |
| 2 | + |
| 3 | +# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation. |
| 4 | +# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the |
| 5 | +# resulting binaries. |
| 6 | +# It then calls another reusable workflow to run the Ragger tests on the compiled application binary. |
| 7 | +# |
| 8 | +# While this workflow is optional, having functional testing on your application is mandatory and this workflow and |
| 9 | +# tooling environment is meant to be easy to use and adapt after forking your application |
| 10 | + |
| 11 | +on: |
| 12 | + workflow_call: |
| 13 | + inputs: |
| 14 | + branch_for_ethereum: |
| 15 | + required: false |
| 16 | + default: 'develop' |
| 17 | + type: string |
| 18 | + |
| 19 | + test_filter: |
| 20 | + required: false |
| 21 | + default: '""' |
| 22 | + type: string |
| 23 | + |
| 24 | + regenerate_snapshots: |
| 25 | + description: 'Clean snapshots, regenerate them, commit the changes in a branch, and open a PR' |
| 26 | + required: false |
| 27 | + default: false |
| 28 | + type: boolean |
| 29 | + |
| 30 | +jobs: |
| 31 | + build_application: |
| 32 | + name: Build application using the reusable workflow |
| 33 | + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 |
| 34 | + with: |
| 35 | + app_repository: LedgerHQ/app-ethereum |
| 36 | + app_branch_name: ${{ inputs.branch_for_ethereum }} |
| 37 | + upload_app_binaries_artifact: "ragger_elfs" |
| 38 | + flags: "CAL_TEST_KEY=1 TRUSTED_NAME_TEST_KEY=1 SET_PLUGIN_TEST_KEY=1 NFT_TEST_KEY=1" |
| 39 | + |
| 40 | + ragger_tests: |
| 41 | + name: Run ragger tests using the reusable workflow |
| 42 | + needs: build_application |
| 43 | + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 |
| 44 | + with: |
| 45 | + app_repository: LedgerHQ/app-ethereum |
| 46 | + app_branch_name: ${{ inputs.branch_for_ethereum }} |
| 47 | + download_app_binaries_artifact: "ragger_elfs" |
| 48 | + test_filter: ${{ inputs.test_filter }} |
| 49 | + regenerate_snapshots: ${{ inputs.regenerate_snapshots }} |
| 50 | + |
| 51 | + build_clone_app: |
| 52 | + name: Build Clone app using the reusable workflow |
| 53 | + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 |
| 54 | + with: |
| 55 | + app_repository: LedgerHQ/app-ethereum |
| 56 | + app_branch_name: ${{ inputs.branch_for_ethereum }} |
| 57 | + flags: "CHAIN=thundercore" |
| 58 | + upload_app_binaries_artifact: "clone_elfs" |
| 59 | + |
| 60 | + ragger_clone_tests: |
| 61 | + name: Run ragger Clone tests using the reusable workflow |
| 62 | + needs: |
| 63 | + - build_application |
| 64 | + - build_clone_app |
| 65 | + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 |
| 66 | + with: |
| 67 | + app_repository: LedgerHQ/app-ethereum |
| 68 | + app_branch_name: ${{ inputs.branch_for_ethereum }} |
| 69 | + download_app_binaries_artifact: "ragger_elfs" |
| 70 | + additional_app_binaries_artifact: "clone_elfs" |
| 71 | + additional_app_binaries_artifact_dir: ./tests/ragger/.test_dependencies/clone/build/ |
| 72 | + test_options: "--with_lib_mode" |
| 73 | + test_filter: ${{ inputs.test_filter }} |
| 74 | + regenerate_snapshots: ${{ inputs.regenerate_snapshots }} |
0 commit comments