diff --git a/.github/workflows/build_and_functional_tests.yml b/.github/workflows/build_and_functional_tests.yml index c1a7c90..4799867 100644 --- a/.github/workflows/build_and_functional_tests.yml +++ b/.github/workflows/build_and_functional_tests.yml @@ -1,12 +1,4 @@ -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. -# -# While 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 +name: Build and run zemu tests on: workflow_dispatch: @@ -19,6 +11,7 @@ on: branches: - develop - master + - dev jobs: build_application: @@ -30,7 +23,46 @@ jobs: zemu_tests: name: Run zemu tests - needs: build_application + needs: [build_application] runs-on: ubuntu-latest steps: - - run: cd tests_zemu && yarn test \ No newline at end of file + - uses: actions/checkout@v4 + + - name: Wait for artifacts (debug) + run: | + for i in {1..5}; do + echo "Attempt $i: Checking for artifacts..." + gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \ + | jq -r '.artifacts[] | "- " + .name' + if [ $? -eq 0 ]; then + break + fi + sleep 10 + done + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: compiled_app_binaries + path: temp_artifacts + + - name: Restructure artifacts + run: | + mkdir -p build + cp -r temp_artifacts/* build/ + rm -rf temp_artifacts + + - name: Debug - Show directory structure + run: | + echo "Build directory contents:" + ls -R build/ + + - name: Install dependencies + run: cd tests_zemu && yarn install + - name: Run tests + run: cd tests_zemu && yarn test \ No newline at end of file