-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'stencil/develop' into develop
- Loading branch information
Showing
6 changed files
with
155 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Build and run functional tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
- develop-sync | ||
pull_request: | ||
|
||
jobs: | ||
build_application: | ||
name: Build application using the reusable workflow | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@jca/update_reusable_build | ||
with: | ||
upload_app_binaries_artifact: "compiled_app_binaries" | ||
builder: ledger-app-builder | ||
|
||
functional_tests: | ||
name: Run tests | ||
needs: build_application | ||
uses: ./.github/workflows/functional_tests.yml | ||
with: | ||
download_app_binaries_artifact: "compiled_app_binaries" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
--- | ||
name: Functional tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
app_repository: | ||
description: 'The GIT repository to test (defaults to `github.repository`)' | ||
required: false | ||
default: ${{ github.repository }} | ||
type: string | ||
app_branch_name: | ||
description: 'The GIT branch to test (defaults to `github.ref`)' | ||
required: false | ||
default: ${{ github.ref }} | ||
type: string | ||
download_app_binaries_artifact: | ||
description: 'The name of the artifact containing the application binary file(s) to be tested. Required' | ||
required: true | ||
type: string | ||
run_for_devices: | ||
description: | | ||
The list of device(s) on which the test will run. | ||
Defaults to the full list of device(s) supported by the application as configured in the | ||
'ledger_app.toml' manifest. | ||
If the manifest is missing, defaults to ALL (["nanos", "nanox", "nanosp", "stax"]). | ||
required: false | ||
default: 'None' | ||
type: string | ||
upload_snapshots_on_failure: | ||
description: 'Enable or disable upload of tests snapshots if the job fails (defaults to true).' | ||
required: false | ||
default: true | ||
type: boolean | ||
test_filter: | ||
description: 'Specify an expression which implements a substring match on the test names' | ||
required: false | ||
default: '""' | ||
type: string | ||
|
||
jobs: | ||
call_get_app_metadata: | ||
# This job digests inputs and repository metadata provided by the `ledger_app.toml` manifest | ||
# file, in order to output relevant directories, compatible devices, and other variables needed | ||
# by following jobs. | ||
name: Retrieve application metadata | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/_get_app_metadata.yml@v1 | ||
with: | ||
app_repository: ${{ inputs.app_repository }} | ||
app_branch_name: ${{ inputs.app_branch_name }} | ||
compatible_devices: ${{ inputs.run_for_devices }} | ||
|
||
functional_tests: | ||
name: Functional tests | ||
needs: call_get_app_metadata | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
device: ${{ fromJSON(needs.call_get_app_metadata.outputs.compatible_devices) }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ inputs.app_repository }} | ||
ref: ${{ inputs.app_branch_name }} | ||
submodules: recursive | ||
|
||
- name: Download app binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.download_app_binaries_artifact }} | ||
path: ${{ needs.call_get_app_metadata.outputs.build_directory }}/build/ | ||
|
||
- name: Set Node.js 20.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Install yarn | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install # will run `yarn install` command | ||
dir: 'ts-tests' | ||
|
||
- name: Install tests dependencies | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y qemu-user-static tesseract-ocr libtesseract-dev | ||
pip install -U pip setuptools | ||
pip install speculos | ||
- name: Run test | ||
run: | | ||
BIN_DIR_NAME="$(echo ${{ matrix.device }} | sed 's/nanosp/nanos2/')" | ||
speculos --api-port 5005 ${{ needs.call_get_app_metadata.outputs.build_directory }}/build/${BIN_DIR_NAME}/bin/app.elf --display headless & | ||
sleep 5 | ||
cd ts-tests | ||
yarn run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Ensure compliance with Ledger guidelines | ||
|
||
# This workflow is mandatory in all applications | ||
# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team. | ||
# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger | ||
# application store. | ||
# | ||
# More information on the guidelines can be found in the repository: | ||
# LedgerHQ/ledger-app-workflows/ | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
guidelines_enforcer: | ||
name: Call Ledger guidelines_enforcer | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters