Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split build and test CI entry point from workflow to provide a reusable interface #96

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions .github/workflows/build_and_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Build and run functional tests using ragger through reusable workflow
name: Call build and tests entry point

# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation.
# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the
# resulting binaries.
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary.
# This workflow will call the companion workflow reusable_build_and_functional_tests.yml of this repository
#
# The build part of this workflow is mandatory, this ensures that the app will be deployable in the Ledger App Store.
# While the test part of this workflow is optional, having functional testing on your application is mandatory and this workflow and
Expand All @@ -28,17 +25,9 @@ on:
pull_request:

jobs:
build_application:
name: Build application using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
job_call_build_and_test:
name: Build and test
uses: ./.github/workflows/reusable_build_and_functional_tests.yml
with:
upload_app_binaries_artifact: "compiled_app_binaries"
builder: ledger-app-builder

ragger_tests:
name: Run ragger tests using the reusable workflow
needs: build_application
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
download_app_binaries_artifact: "compiled_app_binaries"
branch: ${{ github.ref }}
regenerate_snapshots: ${{ inputs.golden_run == 'Open a PR' }}
51 changes: 51 additions & 0 deletions .github/workflows/reusable_build_and_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and run functional tests using ragger entry point

# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation.
# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the
# resulting binaries.
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary.
#
# This workflow is itself written as a reusable workflow so it can be triggered by itself (file
# build_and_functional_tests.yml), or triggered by external repositories CI (used by various non regression workflows
# we have). You do not need to keep this split, so you can merge this file and build_and_functional_tests.yml on your
# fork

on:
workflow_call:
inputs:
branch:
required: false
default: 'main'
type: string

test_filter:
required: false
default: '""'
type: string

regenerate_snapshots:
description: 'Clean snapshots, regenerate them, commit the changes in a branch, and open a PR'
required: false
default: false
type: boolean

jobs:
build_application:
name: Build application using the reusable workflow
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
with:
app_repository: LedgerHQ/app-boilerplate-rust
app_branch_name: ${{ inputs.branch }}
upload_app_binaries_artifact: "compiled_app_binaries"
builder: ledger-app-builder

ragger_tests:
name: Run ragger tests using the reusable workflow
needs: build_application
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
with:
app_repository: LedgerHQ/app-boilerplate-rust
app_branch_name: ${{ inputs.branch }}
download_app_binaries_artifact: "compiled_app_binaries"
test_filter: ${{ inputs.test_filter }}
regenerate_snapshots: ${{ inputs.regenerate_snapshots }}
Loading