Skip to content

Commit

Permalink
Fix CI zemu_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xPxt committed Nov 21, 2024
1 parent bd75db5 commit d583193
Showing 1 changed file with 43 additions and 11 deletions.
54 changes: 43 additions & 11 deletions .github/workflows/build_and_functional_tests.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -19,6 +11,7 @@ on:
branches:
- develop
- master
- dev

jobs:
build_application:
Expand All @@ -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
- 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

0 comments on commit d583193

Please sign in to comment.