[auto-update] Update Ragger snapshots #1277
This file contains hidden or 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
| name: Build and run functional tests using ragger through reusable workflow | |
| # 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. | |
| # | |
| # 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 | |
| # tooling environment is meant to be easy to use and adapt after forking your application | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| golden_run: | |
| type: choice | |
| required: true | |
| default: 'Raise an error (default)' | |
| description: CI behavior if the test snapshots are different than expected. | |
| options: | |
| - 'Raise an error (default)' | |
| - 'Open a PR' | |
| delete_obsolete_snapshots: | |
| type: boolean | |
| required: false | |
| default: false | |
| description: When opening a PR, also delete snapshots that are no longer generated (e.g. for removed/renamed tests). Only safe for a full-suite regeneration. | |
| push: | |
| branches: | |
| - master | |
| - main | |
| - develop | |
| pull_request: | |
| jobs: | |
| build_application: | |
| name: Build application using the reusable workflow | |
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | |
| with: | |
| upload_app_binaries_artifact: "compiled_app_binaries" | |
| flags: "DEBUG=0 COIN=bitcoin_testnet" | |
| build_comparison: true | |
| enable_stack_consumption: true | |
| 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" | |
| container_image: "ghcr.io/ledgerhq/app-bitcoin/speculos-bitcoin:latest" | |
| # when merging a PR, we run the tests with the --enable_slow_tests parameter | |
| test_options: ${{ github.event_name == 'push' && '--enable_slow_tests' || '' }} | |
| regenerate_snapshots: ${{ github.event_name == 'workflow_dispatch' && inputs.golden_run == 'Open a PR' }} | |
| also_delete_snapshots: ${{ github.event_name == 'workflow_dispatch' && inputs.golden_run == 'Open a PR' && inputs.delete_obsolete_snapshots }} | |
| post_stack_consumption: true | |
| ragger_coverage: | |
| name: Functional tests coverage using the reusable workflow | |
| # Builds the app with debug symbols and runs the ragger | |
| # tests with coverage tracing; uploads the lcov file + HTML report as the | |
| # 'coverage-<device>' artifact(s) and to codecov under the 'functionaltests' flag. | |
| uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_coverage.yml@v1 | |
| with: | |
| run_for_devices: '["flex"]' | |
| flags: "DEBUG=1 COIN=bitcoin_testnet" | |
| container_image: "ghcr.io/ledgerhq/app-bitcoin-new/speculos-bitcoin:latest" | |
| secrets: | |
| codecov_token: ${{ secrets.CODECOV_TOKEN }} |