From 4bdd73ffc9f5efb08739c07ec6361b70faae5f8e Mon Sep 17 00:00:00 2001 From: James Kessler Date: Thu, 26 Sep 2024 20:01:15 -0400 Subject: [PATCH] Test Linux Binaries after they're built in CI (Cont'd) (#157) * Add new debug step to test-binaries workflow to address artifact-download issue. * Add new workflow, test-binaries-qemu, to test binaries in QEMU emulation. * Merge to master asap to see changes as these workflows only run on our default branch. --- .github/workflows/test-binaries-qemu.yml | 56 ++++++++++++++++++++++++ .github/workflows/test-binaries.yml | 11 ++--- 2 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test-binaries-qemu.yml diff --git a/.github/workflows/test-binaries-qemu.yml b/.github/workflows/test-binaries-qemu.yml new file mode 100644 index 0000000..8d47935 --- /dev/null +++ b/.github/workflows/test-binaries-qemu.yml @@ -0,0 +1,56 @@ +name: test-binaries-qemu + +on: + workflow_run: + workflows: [build] + types: + - completed + +jobs: + test-x86_64: + runs-on: ubuntu-22.04 + steps: + # Debug step to list artifacts for the run + - name: List available artifacts + run: | + echo "Available artifacts:" + curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" | jq '.artifacts[] | .name' + - name: Download coveralls-linux-x86_64 binary + uses: actions/download-artifact@v4 + with: + name: coveralls-linux-binaries + path: ./artifacts + - name: Test binary + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | + chmod +x ./artifacts/coveralls-linux-x86_64 + ./artifacts/coveralls-linux-x86_64 --version + ./artifacts/coveralls-linux-x86_64 report --measure --base-path src/coverage_reporter/ + + test-aarch64: + runs-on: ubuntu-22.04 + steps: + # Debug step to list artifacts for the run + - name: List available artifacts + run: | + echo "Available artifacts:" + curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" | jq '.artifacts[] | .name' + - name: Set up QEMU for aarch64 emulation + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/arm64 # Or qemu-aarch64? + - name: Download coveralls-linux-aarch64 binary + uses: actions/download-artifact@v4 + with: + name: coveralls-linux-binaries + path: ./artifacts + - name: Test binary + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + run: | + chmod +x ./artifacts/coveralls-linux-aarch64 + ./artifacts/coveralls-linux-aarch64 --version + ./artifacts/coveralls-linux-aarch64 report --measure --base-path src/coverage_reporter/ diff --git a/.github/workflows/test-binaries.yml b/.github/workflows/test-binaries.yml index 80fa52b..1be96fa 100644 --- a/.github/workflows/test-binaries.yml +++ b/.github/workflows/test-binaries.yml @@ -19,11 +19,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # # Debug Step to Print Event Context - # - name: Print event context - # env: - # GITHUB_CONTEXT: ${{ toJson(github) }} - # run: echo "$GITHUB_CONTEXT" + # Debug step to list artifacts for the run + - name: List available artifacts + run: | + echo "Available artifacts:" + curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" | jq '.artifacts[] | .name' - name: Download built artifacts (linux binaries) uses: actions/download-artifact@v4