Try fix CI: to remove #1
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
name: Reusable swap functional tests | ||
on: | ||
workflow_call: | ||
inputs: | ||
run_for_devices: | ||
description: 'The list of device(s) on which the test will run (defaults to ["nanos", "nanox", "nanosp", "stax"])' | ||
required: false | ||
default: '["nanos", "nanox", "nanosp", "stax"]' | ||
type: string | ||
branch_for_exchange: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_stellar: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_tezos_legacy: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_tezos: | ||
required: false | ||
default: 'main' | ||
type: string | ||
branch_for_xrp: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_ethereum: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_ethereum_classic: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_litecoin: | ||
required: false | ||
default: 'master' | ||
type: string | ||
branch_for_bitcoin_legacy: | ||
required: false | ||
default: 'master' | ||
type: string | ||
branch_for_bitcoin: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_solana: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
branch_for_bsc: | ||
required: false | ||
default: 'develop' | ||
type: string | ||
test_filter: | ||
required: false | ||
default: '""' | ||
type: string | ||
jobs: | ||
build_sideloaded_applications: | ||
name: Build sideloaded applications using the reusable workflow | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
coin: | ||
- name: stellar | ||
repo: LedgerHQ/app-stellar | ||
branch: ${{ inputs.branch_for_stellar }} | ||
relative_app_directory: '.' | ||
- name: tezos_legacy | ||
repo: LedgerHQ/app-tezos | ||
branch: ${{ inputs.branch_for_tezos_legacy }} | ||
relative_app_directory: '.' | ||
- name: tezos_new | ||
repo: trilitech/ledger-app-tezos-wallet | ||
branch: ${{ inputs.branch_for_tezos }} | ||
relative_app_directory: 'app' | ||
- name: xrp | ||
repo: LedgerHQ/app-xrp | ||
branch: ${{ inputs.branch_for_xrp }} | ||
relative_app_directory: '.' | ||
- name: ethereum | ||
repo: LedgerHQ/app-ethereum | ||
branch: ${{ inputs.branch_for_ethereum }} | ||
relative_app_directory: '.' | ||
- name: ethereum_classic | ||
repo: LedgerHQ/app-ethereum | ||
branch: ${{ inputs.branch_for_ethereum_classic }} | ||
relative_app_directory: '.' | ||
- name: litecoin | ||
repo: LedgerHQ/app-bitcoin | ||
branch: ${{ inputs.branch_for_litecoin }} | ||
relative_app_directory: '.' | ||
- name: bitcoin_legacy | ||
repo: LedgerHQ/app-bitcoin | ||
branch: ${{ inputs.branch_for_bitcoin_legacy }} | ||
relative_app_directory: '.' | ||
- name: bitcoin | ||
repo: LedgerHQ/app-bitcoin-new | ||
branch: ${{ inputs.branch_for_bitcoin }} | ||
relative_app_directory: '.' | ||
- name: solana | ||
repo: LedgerHQ/app-solana | ||
branch: ${{ inputs.branch_for_solana }} | ||
relative_app_directory: '.' | ||
- name: bsc | ||
repo: LedgerHQ/app-ethereum | ||
branch: ${{ inputs.branch_for_bsc }} | ||
relative_app_directory: '.' | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | ||
with: | ||
app_repository: ${{ matrix.coin.repo }} | ||
app_branch_name: ${{ matrix.coin.branch }} | ||
relative_app_directory: ${{ matrix.coin.relative_app_directory }} | ||
flags: "COIN=${{ matrix.coin.name }} CHAIN=${{ matrix.coin.name }} DEBUG=1" | ||
upload_app_binaries_artifact: libraries_binaries | ||
upload_as_lib_artifact: ${{ matrix.coin.name }} | ||
build_exchange_application: | ||
name: Build application using the reusable workflow | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | ||
with: | ||
app_repository: LedgerHQ/app-exchange | ||
app_branch_name: ${{ inputs.branch_for_exchange }} | ||
flags: "TESTING=1 TEST_PUBLIC_KEY=1 DEBUG=1" | ||
upload_app_binaries_artifact: exchange_binaries | ||
ragger_tests: | ||
name: Run ragger tests using the reusable workflow | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
device: ${{ fromJSON(inputs.run_for_devices) }} | ||
needs: | ||
- build_exchange_application | ||
- build_sideloaded_applications | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.repository }} | ||
ref: ${{ github.ref }} | ||
submodules: recursive | ||
- name: Download app binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: exchange_binaries | ||
path: build/ | ||
- name: Download additional lib binaries if required | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: libraries_binaries | ||
path: test/python/lib_binaries/ | ||
- 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 | ||
ls . | ||
ls test | ||
ls test/python | ||
pip install -r test/python/requirements.txt | ||
- name: Run test | ||
env: | ||
CTEST_OUTPUT_ON_FAILURE: 1 | ||
run: pytest test/python/ --tb=short -v --device ${{ matrix.device }} -k ${{ inputs.test_filter }} | ||
- name: Upload snapshots | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.device }}-tests-snapshots | ||
path: test/python/snapshots-tmp/${{ matrix.device }} | ||
# Legacy | ||
zemu_tests: | ||
name: Zemu tests | ||
strategy: | ||
matrix: | ||
# device: ["Nano S", "Nano X", "Nano SP"] | ||
device: ["Nano S"] | ||
needs: | ||
- build_exchange_application | ||
- build_sideloaded_applications | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.repository }} | ||
ref: ${{ github.ref }} | ||
- name: Install APT dependencies | ||
run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev | ||
- name: Install Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Install Yarn | ||
run: npm install -g yarn | ||
- name: Install JS dependencies | ||
run: cd test && yarn install | ||
- name: Download all binaries | ||
uses: actions/download-artifact@v3 | ||
- name: Download exchange binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: exchange_binaries | ||
path: ./build/ | ||
- name: Download lib binaries | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: libraries_binaries | ||
path: ./test/python/lib_binaries/ | ||
- name: Dispatch to the tests/elfs | ||
run: | | ||
./copy_elfs_for_zemu.sh | ||
tree test/elfs | ||
- name: Run zemu tests for device ${{ matrix.device }} | ||
run: cd test && yarn test -t "\[${{ matrix.device }}\]" |