Skip to content

Commit 9db06ec

Browse files
Split build and test CI entry point from workflow to provide a reusable interface
1 parent 619d7cd commit 9db06ec

File tree

2 files changed

+78
-32
lines changed

2 files changed

+78
-32
lines changed

.github/workflows/build_and_functional_tests.yml

+4-32
Original file line numberDiff line numberDiff line change
@@ -27,37 +27,9 @@ on:
2727
pull_request:
2828

2929
jobs:
30-
build_application:
31-
name: Build application using the reusable workflow
32-
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
30+
job_call_build_and_test:
31+
name: Build and test
32+
uses: ./.github/workflows/reusable_build_and_functional_tests.yml
3333
with:
34-
upload_app_binaries_artifact: "ragger_elfs"
35-
flags: "CAL_TEST_KEY=1 TRUSTED_NAME_TEST_KEY=1 SET_PLUGIN_TEST_KEY=1 NFT_TEST_KEY=1"
36-
37-
ragger_tests:
38-
name: Run ragger tests using the reusable workflow
39-
needs: build_application
40-
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
41-
with:
42-
download_app_binaries_artifact: "ragger_elfs"
43-
regenerate_snapshots: ${{ inputs.golden_run == 'Open a PR' }}
44-
45-
build_clone_app:
46-
name: Build Clone app using the reusable workflow
47-
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
48-
with:
49-
flags: "CHAIN=thundercore"
50-
upload_app_binaries_artifact: "clone_elfs"
51-
52-
ragger_clone_tests:
53-
name: Run ragger Clone tests using the reusable workflow
54-
needs:
55-
- build_application
56-
- build_clone_app
57-
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
58-
with:
59-
download_app_binaries_artifact: "ragger_elfs"
60-
additional_app_binaries_artifact: "clone_elfs"
61-
additional_app_binaries_artifact_dir: ./tests/ragger/.test_dependencies/clone/build/
62-
test_options: "--with_lib_mode"
34+
branch_for_ethereum: ${{ github.ref }}
6335
regenerate_snapshots: ${{ inputs.golden_run == 'Open a PR' }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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

Comments
 (0)