Skip to content

Commit 38f364e

Browse files
Split build and test CI entry point from workflow to provide a reusable interface
1 parent 9c2ea1c commit 38f364e

File tree

2 files changed

+56
-16
lines changed

2 files changed

+56
-16
lines changed

.github/workflows/build_and_functional_tests.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: Build and run functional tests using ragger through reusable workflow
1+
name: Call build and tests entry point
22

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.
3+
# This workflow will call the companion workflow reusable_build_and_functional_tests.yml of this repository
74
#
85
# The build part of this workflow is mandatory, this ensures that the app will be deployable in the Ledger App Store.
96
# While the test part of this workflow is optional, having functional testing on your application is mandatory and this workflow and
@@ -28,16 +25,9 @@ on:
2825
pull_request:
2926

3027
jobs:
31-
build_application:
32-
name: Build application using the reusable workflow
33-
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
28+
job_call_build_and_test:
29+
name: Build and test
30+
uses: ./.github/workflows/reusable_build_and_functional_tests.yml
3431
with:
35-
upload_app_binaries_artifact: "compiled_app_binaries"
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: "compiled_app_binaries"
32+
branch: ${{ github.ref }}
4333
regenerate_snapshots: ${{ inputs.golden_run == 'Open a PR' }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build and run functional tests using ragger entry point
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+
# This workflow is itself written as a reusable workflow so it can be triggered by itself (file
9+
# build_and_functional_tests.yml), or triggered by external repositories CI (used by various non regression workflows
10+
# we have). You do not need to keep this split, so you can merge this file and build_and_functional_tests.yml on your
11+
# fork
12+
13+
on:
14+
workflow_call:
15+
inputs:
16+
branch:
17+
required: false
18+
default: 'master'
19+
type: string
20+
21+
test_filter:
22+
required: false
23+
default: '""'
24+
type: string
25+
26+
regenerate_snapshots:
27+
description: 'Clean snapshots, regenerate them, commit the changes in a branch, and open a PR'
28+
required: false
29+
default: false
30+
type: boolean
31+
32+
jobs:
33+
build_application:
34+
name: Build application using the reusable workflow
35+
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
36+
with:
37+
app_repository: LedgerHQ/app-boilerplate
38+
app_branch_name: ${{ inputs.branch }}
39+
upload_app_binaries_artifact: "compiled_app_binaries"
40+
41+
ragger_tests:
42+
name: Run ragger tests using the reusable workflow
43+
needs: build_application
44+
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
45+
with:
46+
app_repository: LedgerHQ/app-boilerplate
47+
app_branch_name: ${{ inputs.branch }}
48+
download_app_binaries_artifact: "compiled_app_binaries"
49+
test_filter: ${{ inputs.test_filter }}
50+
regenerate_snapshots: ${{ inputs.regenerate_snapshots }}

0 commit comments

Comments
 (0)