From 9eee04ad6668619c33ba8c3aca9a62772622ddb5 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Fri, 27 Sep 2024 14:17:01 -0700 Subject: [PATCH 01/34] Trigger CI. From 199d3c3f5aa72260db78400c9bd2eeec376df1bf Mon Sep 17 00:00:00 2001 From: James Kessler Date: Fri, 27 Sep 2024 14:33:11 -0700 Subject: [PATCH 02/34] Fix duplicate key (permissions:) in build.yml. --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f11491..2070274 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,6 @@ on: tags: - 'v*' -permissions: - contents: write - jobs: build-windows: runs-on: windows-2022 From ea5f81254d28f2144f1c18d93760c6f120473c93 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Sun, 29 Sep 2024 22:25:49 -0700 Subject: [PATCH 03/34] Try adding test jobs to build.yml workflow after build-linux job. --- .github/workflows/build.yml | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2070274..a5b8094 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -156,7 +156,42 @@ jobs: - name: List files in dist/ directory run: ls -la dist/ - release: + test-linux-x86_64: + runs-on: ubuntu-latest + needs: build-linux + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download x86_64 binary + uses: actions/download-artifact@v4 + with: + name: coveralls-linux-x86_64 + path: ./binaries/ + + - name: Test x86_64 binary + run: ./binaries/coveralls-linux-x86_64 --version + + test-linux-aarch64: + runs-on: ubuntu-latest + needs: build-linux + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download aarch64 binary + uses: actions/download-artifact@v4 + with: + name: coveralls-linux-aarch64 + path: ./binaries/ + + - name: Test aarch64 binary in QEMU + run: | + sudo apt-get update + sudo apt-get install -y qemu-user + qemu-aarch64 ./binaries/coveralls-linux-aarch64 --version + + release: runs-on: ubuntu-latest needs: [build-windows, build-linux] env: From 29357df30143afff33d3a4abf85a42079a41923b Mon Sep 17 00:00:00 2001 From: James Kessler Date: Sun, 29 Sep 2024 22:30:10 -0700 Subject: [PATCH 04/34] Fix syntax error in build.yml. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5b8094..4a36124 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -191,7 +191,7 @@ jobs: sudo apt-get install -y qemu-user qemu-aarch64 ./binaries/coveralls-linux-aarch64 --version - release: + release: runs-on: ubuntu-latest needs: [build-windows, build-linux] env: From 027cd43e90aebe21fd8df142b7e8990c793c52b8 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Sun, 29 Sep 2024 22:42:54 -0700 Subject: [PATCH 05/34] Give executable permissions to binaries. --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a36124..6cbf404 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,7 +168,10 @@ jobs: with: name: coveralls-linux-x86_64 path: ./binaries/ - + + - name: Set executable permissions for x86_64 binary + run: chmod +x ./binaries/coveralls-linux-x86_64 + - name: Test x86_64 binary run: ./binaries/coveralls-linux-x86_64 --version @@ -184,6 +187,9 @@ jobs: with: name: coveralls-linux-aarch64 path: ./binaries/ + + - name: Set executable permissions for aarch64 binary + run: chmod +x ./binaries/coveralls-linux-aarch64 - name: Test aarch64 binary in QEMU run: | From 80be041a6b4be8e2379c7e3f29cb29761e01eaeb Mon Sep 17 00:00:00 2001 From: James Kessler Date: Sun, 29 Sep 2024 23:16:27 -0700 Subject: [PATCH 06/34] Obtain test binaries as outputs from the previous step rather than uploading and downloading as artifacts. --- .github/workflows/build.yml | 99 ++++++++++++------------------------- 1 file changed, 32 insertions(+), 67 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cbf404..2aff563 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,14 +68,12 @@ jobs: build-linux: runs-on: ubuntu-latest + outputs: + x86_64_binary: ${{ steps.build.outputs.coveralls_x86_64 }} + aarch64_binary: ${{ steps.build.outputs.coveralls_aarch64 }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - # # Debug step to verify event context - # - name: Print event context for build-linux - # run: | - # echo "${{ toJson(github.event) }}" - - name: Checkout code uses: actions/checkout@v4 @@ -91,7 +89,10 @@ jobs: run: make build-xbuild-container - name: Build cross-compiled linux binaries - run: make compile-and-strip-all + run: | + make compile-and-strip-all + echo "::set-output name=coveralls_x86_64::dist/coveralls-linux-x86_64" + echo "::set-output name=coveralls_aarch64::dist/coveralls-linux-aarch64" - name: Package linux binaries run: make package @@ -107,51 +108,6 @@ jobs: path: dist/* if-no-files-found: error - - name: Create Trigger File - run: echo "test-binaries-trigger" > test-binaries-trigger.txt - - - name: Upload Trigger Artifact - uses: actions/upload-artifact@v4 - with: - name: test-binaries-trigger - path: test-binaries-trigger.txt - -# - name: Upload coveralls-linux -# uses: actions/upload-artifact@v4 -# with: -# name: coveralls-linux -# path: dist/coveralls-linux -# -# - name: Upload coveralls-linux.tar.gz -# uses: actions/upload-artifact@v4 -# with: -# name: coveralls-linux.tar.gz -# path: dist/coveralls-linux.tar.gz -# - - name: Upload coveralls-linux-x86_64 - uses: actions/upload-artifact@v4 - with: - name: coveralls-linux-x86_64 - path: dist/coveralls-linux-x86_64 -# -# - name: Upload coveralls-linux-x86_64.tar.gz -# uses: actions/upload-artifact@v4 -# with: -# name: coveralls-linux-x86_64.tar.gz -# path: dist/coveralls-linux-x86_64.tar.gz -# - - name: Upload coveralls-linux-aarch64 - uses: actions/upload-artifact@v4 - with: - name: coveralls-linux-aarch64 - path: dist/coveralls-linux-aarch64 -# -# - name: Upload coveralls-linux-aarch64.tar.gz -# uses: actions/upload-artifact@v4 -# with: -# name: coveralls-linux-aarch64.tar.gz -# path: dist/coveralls-linux-aarch64.tar.gz - # Debug step to verify what files are in the dist/ directory - name: List files in dist/ directory run: ls -la dist/ @@ -163,17 +119,24 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Download x86_64 binary - uses: actions/download-artifact@v4 - with: - name: coveralls-linux-x86_64 - path: ./binaries/ + # - name: Download x86_64 binary + # uses: actions/download-artifact@v4 + # with: + # name: coveralls-linux-x86_64 + # path: ./binaries/ - - name: Set executable permissions for x86_64 binary - run: chmod +x ./binaries/coveralls-linux-x86_64 + # - name: Set executable permissions for x86_64 binary + # run: chmod +x ./binaries/coveralls-linux-x86_64 + # - name: Test x86_64 binary + # run: ./binaries/coveralls-linux-x86_64 --version + + # Using output from build-linux job - name: Test x86_64 binary - run: ./binaries/coveralls-linux-x86_64 --version + run: | + binary=${{ needs.build-linux.outputs.x86_64_binary }} + chmod +x $binary + $binary --version test-linux-aarch64: runs-on: ubuntu-latest @@ -182,20 +145,22 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Download aarch64 binary - uses: actions/download-artifact@v4 - with: - name: coveralls-linux-aarch64 - path: ./binaries/ + # - name: Download aarch64 binary + # uses: actions/download-artifact@v4 + # with: + # name: coveralls-linux-aarch64 + # path: ./binaries/ - - name: Set executable permissions for aarch64 binary - run: chmod +x ./binaries/coveralls-linux-aarch64 + # - name: Set executable permissions for aarch64 binary + # run: chmod +x ./binaries/coveralls-linux-aarch64 - name: Test aarch64 binary in QEMU run: | + binary=${{ needs.build-linux.outputs.aarch64_binary }} + chmod +x $binary sudo apt-get update sudo apt-get install -y qemu-user - qemu-aarch64 ./binaries/coveralls-linux-aarch64 --version + qemu-aarch64 $binary --version release: runs-on: ubuntu-latest From 939ee20ac1af720c26089afd39f4cb0f4e679f5e Mon Sep 17 00:00:00 2001 From: James Kessler Date: Sun, 29 Sep 2024 23:55:37 -0700 Subject: [PATCH 07/34] Fix issues with referencing binaries as outputs from a previous step. --- .github/workflows/build.yml | 61 ++++++++++++++++++++++--------------- .github/workflows/ci.yml | 6 ++++ 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2aff563..115a1d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,17 +89,18 @@ jobs: run: make build-xbuild-container - name: Build cross-compiled linux binaries + id: build run: | make compile-and-strip-all - echo "::set-output name=coveralls_x86_64::dist/coveralls-linux-x86_64" - echo "::set-output name=coveralls_aarch64::dist/coveralls-linux-aarch64" + echo "coveralls_x86_64=dist/coveralls-linux-x86_64" >> $GITHUB_OUTPUT + echo "coveralls_aarch64=dist/coveralls-linux-aarch64" >> $GITHUB_OUTPUT - name: Package linux binaries run: make package - # Debug step to verify what files are in the dist/ directory - - name: List files in dist/ directory - run: ls -la dist/ + # # Debug step to verify what files are in the dist/ directory + # - name: List files in dist/ directory + # run: ls -la dist/ - name: Upload linux binaries uses: actions/upload-artifact@v4 @@ -108,9 +109,9 @@ jobs: path: dist/* if-no-files-found: error - # Debug step to verify what files are in the dist/ directory - - name: List files in dist/ directory - run: ls -la dist/ + # # Debug step to verify what files are in the dist/ directory + # - name: List files in dist/ directory + # run: ls -la dist/ test-linux-x86_64: runs-on: ubuntu-latest @@ -119,25 +120,29 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # - name: Download x86_64 binary + # # Download the coverage report generated from ci.yml + # - name: Download coverage report # uses: actions/download-artifact@v4 # with: - # name: coveralls-linux-x86_64 - # path: ./binaries/ + # name: coverage-report + # path: ./coverage/ - # - name: Set executable permissions for x86_64 binary - # run: chmod +x ./binaries/coveralls-linux-x86_64 - - # - name: Test x86_64 binary - # run: ./binaries/coveralls-linux-x86_64 --version - - # Using output from build-linux job + # Set executable permissions for x86_64 binary and check version - name: Test x86_64 binary run: | binary=${{ needs.build-linux.outputs.x86_64_binary }} chmod +x $binary $binary --version + # # Report coverage using the x86_64 binary + # - name: Report coverage with x86_64 binary + # env: + # COVERALLS_REPO_TOKEN: ${{ github.token }} + # run: | + # binary=${{ needs.build-linux.outputs.x86_64_binary }} + # cd coverage + # $binary report --measure --base-path src/coverage_reporter/ + test-linux-aarch64: runs-on: ubuntu-latest needs: build-linux @@ -145,15 +150,14 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # - name: Download aarch64 binary + # # Download the coverage report generated from ci.yml + # - name: Download coverage report # uses: actions/download-artifact@v4 # with: - # name: coveralls-linux-aarch64 - # path: ./binaries/ + # name: coverage-report + # path: ./coverage/ - # - name: Set executable permissions for aarch64 binary - # run: chmod +x ./binaries/coveralls-linux-aarch64 - + # Set executable permissions for aarch64 binary and check version - name: Test aarch64 binary in QEMU run: | binary=${{ needs.build-linux.outputs.aarch64_binary }} @@ -162,6 +166,15 @@ jobs: sudo apt-get install -y qemu-user qemu-aarch64 $binary --version + # # Report coverage using the tested aarch64 binary + # - name: Report coverage with aarch64 binary + # env: + # COVERALLS_REPO_TOKEN: ${{ github.token }} + # run: | + # binary=${{ needs.build-linux.outputs.aarch64_binary }} + # cd coverage + # qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ + release: runs-on: ubuntu-latest needs: [build-windows, build-linux] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b84d0e3..9a82862 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,3 +68,9 @@ jobs: run: | cd coverage ../bin/coveralls report --measure --base-path src/coverage_reporter/ + + # - name: Upload coverage report + # uses: actions/upload-artifact@v4 + # with: + # name: coverage-report + # path: coverage/ From 4d70c91ed198b35eeff49d34a2d8bf80f385701d Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 00:08:39 -0700 Subject: [PATCH 08/34] Move setting of outputs to the Package linux binaries step of the build-linux job since that is the step that places the new binaries in the dist/ directory. --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 115a1d2..28ba68e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,14 +90,14 @@ jobs: - name: Build cross-compiled linux binaries id: build + run: make compile-and-strip-all + + - name: Package linux binaries run: | - make compile-and-strip-all + make package echo "coveralls_x86_64=dist/coveralls-linux-x86_64" >> $GITHUB_OUTPUT echo "coveralls_aarch64=dist/coveralls-linux-aarch64" >> $GITHUB_OUTPUT - - name: Package linux binaries - run: make package - # # Debug step to verify what files are in the dist/ directory # - name: List files in dist/ directory # run: ls -la dist/ From 3ab35cd60b59915fa115f610e49acf59864d5a5f Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 00:16:39 -0700 Subject: [PATCH 09/34] Add debug steps to find out why test-* jobs aren't finding the binaries in the dist/ directory. --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28ba68e..e157226 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,15 +92,19 @@ jobs: id: build run: make compile-and-strip-all + # Debug step to verify what files are in the dist/ directory + - name: List files in dist/ directory + run: ls -la dist/ + - name: Package linux binaries run: | make package echo "coveralls_x86_64=dist/coveralls-linux-x86_64" >> $GITHUB_OUTPUT echo "coveralls_aarch64=dist/coveralls-linux-aarch64" >> $GITHUB_OUTPUT - # # Debug step to verify what files are in the dist/ directory - # - name: List files in dist/ directory - # run: ls -la dist/ + # Debug step to verify what files are in the dist/ directory + - name: List files in dist/ directory + run: ls -la dist/ - name: Upload linux binaries uses: actions/upload-artifact@v4 @@ -109,10 +113,6 @@ jobs: path: dist/* if-no-files-found: error - # # Debug step to verify what files are in the dist/ directory - # - name: List files in dist/ directory - # run: ls -la dist/ - test-linux-x86_64: runs-on: ubuntu-latest needs: build-linux From 36a21dfa0a1b9fb4d82e611990ca888da3191c4b Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 10:17:25 -0700 Subject: [PATCH 10/34] Fix output declaration in build-linux job, and output references in test-* jobs. --- .github/workflows/build.yml | 12 ++++++------ .github/workflows/test-binaries.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e157226..8a476ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,8 +69,8 @@ jobs: build-linux: runs-on: ubuntu-latest outputs: - x86_64_binary: ${{ steps.build.outputs.coveralls_x86_64 }} - aarch64_binary: ${{ steps.build.outputs.coveralls_aarch64 }} + coveralls_x86_64: ${{ steps.build.outputs.coveralls_x86_64 }} + coveralls_aarch64: ${{ steps.build.outputs.coveralls_aarch64 }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -130,7 +130,7 @@ jobs: # Set executable permissions for x86_64 binary and check version - name: Test x86_64 binary run: | - binary=${{ needs.build-linux.outputs.x86_64_binary }} + binary=${{ needs.build-linux.outputs.coveralls_x86_64 }} chmod +x $binary $binary --version @@ -139,7 +139,7 @@ jobs: # env: # COVERALLS_REPO_TOKEN: ${{ github.token }} # run: | - # binary=${{ needs.build-linux.outputs.x86_64_binary }} + # binary=${{ needs.build-linux.outputs.coveralls_x86_64 }} # cd coverage # $binary report --measure --base-path src/coverage_reporter/ @@ -160,7 +160,7 @@ jobs: # Set executable permissions for aarch64 binary and check version - name: Test aarch64 binary in QEMU run: | - binary=${{ needs.build-linux.outputs.aarch64_binary }} + binary=${{ needs.build-linux.outputs.coveralls_aarch64 }} chmod +x $binary sudo apt-get update sudo apt-get install -y qemu-user @@ -171,7 +171,7 @@ jobs: # env: # COVERALLS_REPO_TOKEN: ${{ github.token }} # run: | - # binary=${{ needs.build-linux.outputs.aarch64_binary }} + # binary=${{ needs.build-linux.outputs.coveralls_aarch64 }} # cd coverage # qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ diff --git a/.github/workflows/test-binaries.yml b/.github/workflows/test-binaries.yml index 2076811..a9709df 100644 --- a/.github/workflows/test-binaries.yml +++ b/.github/workflows/test-binaries.yml @@ -43,14 +43,14 @@ jobs: uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} - name: coveralls-linux-x86_64 + name: coveralls-windows.exe path: ./binaries/ - name: Download built aarch64 binary uses: actions/download-artifact@v4 with: run-id: ${{ github.event.workflow_run.id }} - name: coveralls-linux-aarch64 + name: coveralls-windows.exe path: ./binaries/ # Debug step to list available artifacts From 214c767afe4de86e4263d93a79fc7898a67001fc Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 10:39:08 -0700 Subject: [PATCH 11/34] Fix output declaration in build-linux job, and output references in test-* jobs (again). --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a476ed..56029fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,8 +69,8 @@ jobs: build-linux: runs-on: ubuntu-latest outputs: - coveralls_x86_64: ${{ steps.build.outputs.coveralls_x86_64 }} - coveralls_aarch64: ${{ steps.build.outputs.coveralls_aarch64 }} + coveralls_x86_64: ${{ steps.package.outputs.coveralls_x86_64 }} + coveralls_aarch64: ${{ steps.package.outputs.coveralls_aarch64 }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -97,6 +97,7 @@ jobs: run: ls -la dist/ - name: Package linux binaries + id: package run: | make package echo "coveralls_x86_64=dist/coveralls-linux-x86_64" >> $GITHUB_OUTPUT @@ -131,6 +132,7 @@ jobs: - name: Test x86_64 binary run: | binary=${{ needs.build-linux.outputs.coveralls_x86_64 }} + echo $binary chmod +x $binary $binary --version @@ -161,6 +163,7 @@ jobs: - name: Test aarch64 binary in QEMU run: | binary=${{ needs.build-linux.outputs.coveralls_aarch64 }} + echo $binary chmod +x $binary sudo apt-get update sudo apt-get install -y qemu-user From 6583ab6a8356e0ce321ba2b13ac4b4c46913bc42 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 13:27:02 -0700 Subject: [PATCH 12/34] Switch back to using artifacts between jobs because of failures with files as outputs between jobs. --- .github/workflows/build.yml | 46 ++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56029fa..7cecfd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,27 +121,34 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # # Download the coverage report generated from ci.yml - # - name: Download coverage report - # uses: actions/download-artifact@v4 - # with: - # name: coverage-report - # path: ./coverage/ + # Download the x86_64 binary + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + name: coveralls-linux-binaries + path: test/ # Set executable permissions for x86_64 binary and check version - name: Test x86_64 binary run: | - binary=${{ needs.build-linux.outputs.coveralls_x86_64 }} + binary=test/coveralls-linux-x86_64 echo $binary chmod +x $binary $binary --version + # # Download the coverage report generated from ci.yml + # - name: Download coverage report + # uses: actions/download-artifact@v4 + # with: + # name: coverage-report + # path: ./coverage/ + # # Report coverage using the x86_64 binary # - name: Report coverage with x86_64 binary # env: # COVERALLS_REPO_TOKEN: ${{ github.token }} # run: | - # binary=${{ needs.build-linux.outputs.coveralls_x86_64 }} + # binary=test/coveralls-linux-x86_64 # cd coverage # $binary report --measure --base-path src/coverage_reporter/ @@ -152,29 +159,36 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # # Download the coverage report generated from ci.yml - # - name: Download coverage report - # uses: actions/download-artifact@v4 - # with: - # name: coverage-report - # path: ./coverage/ + # Download the aarch64 binary + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + name: coveralls-linux-binaries + path: test/ # Set executable permissions for aarch64 binary and check version - name: Test aarch64 binary in QEMU run: | - binary=${{ needs.build-linux.outputs.coveralls_aarch64 }} + binary=test/coveralls-linux-aarch64 echo $binary chmod +x $binary sudo apt-get update sudo apt-get install -y qemu-user qemu-aarch64 $binary --version + # # Download the coverage report generated from ci.yml + # - name: Download coverage report + # uses: actions/download-artifact@v4 + # with: + # name: coverage-report + # path: ./coverage/ + # # Report coverage using the tested aarch64 binary # - name: Report coverage with aarch64 binary # env: # COVERALLS_REPO_TOKEN: ${{ github.token }} # run: | - # binary=${{ needs.build-linux.outputs.coveralls_aarch64 }} + # binary=test/coveralls-linux-aarch64 # cd coverage # qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ From 2c3e79dd0f9e77e7b21e0e120ff257b49260c24b Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 13:38:25 -0700 Subject: [PATCH 13/34] Remove remnants of previous outputs solution. Drop remaining debug steps. --- .github/workflows/build.yml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7cecfd5..7971f07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,9 +68,6 @@ jobs: build-linux: runs-on: ubuntu-latest - outputs: - coveralls_x86_64: ${{ steps.package.outputs.coveralls_x86_64 }} - coveralls_aarch64: ${{ steps.package.outputs.coveralls_aarch64 }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -91,21 +88,10 @@ jobs: - name: Build cross-compiled linux binaries id: build run: make compile-and-strip-all - - # Debug step to verify what files are in the dist/ directory - - name: List files in dist/ directory - run: ls -la dist/ - + - name: Package linux binaries id: package - run: | - make package - echo "coveralls_x86_64=dist/coveralls-linux-x86_64" >> $GITHUB_OUTPUT - echo "coveralls_aarch64=dist/coveralls-linux-aarch64" >> $GITHUB_OUTPUT - - # Debug step to verify what files are in the dist/ directory - - name: List files in dist/ directory - run: ls -la dist/ + run: make package - name: Upload linux binaries uses: actions/upload-artifact@v4 @@ -121,8 +107,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # Download the x86_64 binary - - name: Download coverage report + # Download x86_64 binary + - name: Download x86_64 binary uses: actions/download-artifact@v4 with: name: coveralls-linux-binaries @@ -143,7 +129,7 @@ jobs: # name: coverage-report # path: ./coverage/ - # # Report coverage using the x86_64 binary + # # Report coverage with x86_64 binary # - name: Report coverage with x86_64 binary # env: # COVERALLS_REPO_TOKEN: ${{ github.token }} @@ -159,8 +145,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # Download the aarch64 binary - - name: Download coverage report + # Download aarch64 binary + - name: Download aarch64 binary uses: actions/download-artifact@v4 with: name: coveralls-linux-binaries @@ -183,7 +169,7 @@ jobs: # name: coverage-report # path: ./coverage/ - # # Report coverage using the tested aarch64 binary + # # Report coverage with aarch64 binary # - name: Report coverage with aarch64 binary # env: # COVERALLS_REPO_TOKEN: ${{ github.token }} From 5a18922dd334a959ea8da599f0a7412fc5b5980d Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 13:48:59 -0700 Subject: [PATCH 14/34] Test reporting coverage with x86_64 binary. --- .github/workflows/build.yml | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7971f07..9f97fbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,36 +107,34 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # Download x86_64 binary - name: Download x86_64 binary uses: actions/download-artifact@v4 with: name: coveralls-linux-binaries path: test/ - # Set executable permissions for x86_64 binary and check version - - name: Test x86_64 binary + - name: Smoke test x86_64 binary run: | binary=test/coveralls-linux-x86_64 echo $binary chmod +x $binary $binary --version - # # Download the coverage report generated from ci.yml - # - name: Download coverage report - # uses: actions/download-artifact@v4 - # with: - # name: coverage-report - # path: ./coverage/ + # Download the coverage report generated from ci.yml + - name: Download coverage report + uses: actions/download-artifact@v4 + with: + name: coverage-report + path: ./coverage/ - # # Report coverage with x86_64 binary - # - name: Report coverage with x86_64 binary - # env: - # COVERALLS_REPO_TOKEN: ${{ github.token }} - # run: | - # binary=test/coveralls-linux-x86_64 - # cd coverage - # $binary report --measure --base-path src/coverage_reporter/ + # Report coverage with x86_64 binary + - name: Test reporting coverage with x86_64 binary + env: + COVERALLS_REPO_TOKEN: ${{ github.token }} + run: | + binary=test/coveralls-linux-x86_64 + cd coverage + $binary report --measure --base-path src/coverage_reporter/ test-linux-aarch64: runs-on: ubuntu-latest @@ -145,15 +143,13 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # Download aarch64 binary - name: Download aarch64 binary uses: actions/download-artifact@v4 with: name: coveralls-linux-binaries path: test/ - # Set executable permissions for aarch64 binary and check version - - name: Test aarch64 binary in QEMU + - name: Smoke test aarch64 binary in QEMU run: | binary=test/coveralls-linux-aarch64 echo $binary From acb3a8cc111e532ef84edda099cf951f27924cf9 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 14:00:13 -0700 Subject: [PATCH 15/34] Uncomment upload step in ci.yml (duh), and use the COVERALLS_SERVICE_NUMBER env var to add a label and identify the architecture-specific tests of coverage-reporter at Coveralls.io. --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f97fbc..44ac614 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,7 +134,7 @@ jobs: run: | binary=test/coveralls-linux-x86_64 cd coverage - $binary report --measure --base-path src/coverage_reporter/ + COVERALLS_SERVICE_NUMBER=${{ GITHUB_RUN_ID }}-x86_64-test $binary report --measure --base-path src/coverage_reporter/ test-linux-aarch64: runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a82862..16ffbde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,8 +69,8 @@ jobs: cd coverage ../bin/coveralls report --measure --base-path src/coverage_reporter/ - # - name: Upload coverage report - # uses: actions/upload-artifact@v4 - # with: - # name: coverage-report - # path: coverage/ + - name: Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage/ From 14507083696e193e1e6f363684271d35cb563716 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 14:12:01 -0700 Subject: [PATCH 16/34] Fix error in github actions env var syntax. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44ac614..cdbf32d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,7 +134,7 @@ jobs: run: | binary=test/coveralls-linux-x86_64 cd coverage - COVERALLS_SERVICE_NUMBER=${{ GITHUB_RUN_ID }}-x86_64-test $binary report --measure --base-path src/coverage_reporter/ + COVERALLS_SERVICE_NUMBER=${{ github.run_id }}-x86_64-test $binary report --measure --base-path src/coverage_reporter/ test-linux-aarch64: runs-on: ubuntu-latest From fd854ad7385600b9e6f6de0a502264e83ee1fe41 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 14:32:46 -0700 Subject: [PATCH 17/34] Add debug step to make sure coverage report is uploaded as artifact. --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cdbf32d..17c3e0d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,7 +125,7 @@ jobs: uses: actions/download-artifact@v4 with: name: coverage-report - path: ./coverage/ + path: test/ # Report coverage with x86_64 binary - name: Test reporting coverage with x86_64 binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16ffbde..dc56861 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,3 +74,7 @@ jobs: with: name: coverage-report path: coverage/ + + - name: List uploaded artifacts + run: ls -la coverage/ + \ No newline at end of file From b54270fce13804399d4a2d5804901c5b18edfd6a Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 14:38:04 -0700 Subject: [PATCH 18/34] Fix syntax error in ci.yml. Try to use new attributes for cross-workflow artifact sharing supported in actions/download-artifact@v4. --- .github/workflows/build.yml | 2 ++ .github/workflows/ci.yml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17c3e0d..0d19c87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,6 +125,8 @@ jobs: uses: actions/download-artifact@v4 with: name: coverage-report + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} path: test/ # Report coverage with x86_64 binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc56861..917a8fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,6 @@ jobs: name: coverage-report path: coverage/ - - name: List uploaded artifacts + - name: List uploaded artifacts run: ls -la coverage/ \ No newline at end of file From 2695fc796c960b3829981fd084a830b6f747361d Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 16:06:51 -0700 Subject: [PATCH 19/34] Change the way run id is referenced in download step. Add more debugging steps. --- .github/workflows/build.yml | 16 ++++++++++++++-- .github/workflows/ci.yml | 4 ++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d19c87..69f5c08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,15 +119,27 @@ jobs: echo $binary chmod +x $binary $binary --version + + - name: Get latest successful run id for ci.yml + id: get_run_id + run: | + curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/workflows/ci.yml/runs?status=success&branch=master" \ + | jq -r '.workflow_runs[0].id' + + - name: Echo the run-id + run: | + echo "Run ID: ${{ steps.get_run_id.outputs.run-id }}" # Download the coverage report generated from ci.yml - name: Download coverage report uses: actions/download-artifact@v4 with: name: coverage-report - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ secrets.GITHUB_TOKEN }} path: test/ + repository: coverallsapp/coverage-reporter + run-id: ${{ steps.get_run_id.outputs.run-id }} + github-token: ${{ secrets.GITHUB_TOKEN }} # Report coverage with x86_64 binary - name: Test reporting coverage with x86_64 binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 917a8fc..04b2904 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,4 +77,8 @@ jobs: - name: List uploaded artifacts run: ls -la coverage/ + + - name: Debug uploaded artifact + run: | + echo "Artifact URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/" \ No newline at end of file From 84fba76f17a967d030486aa73ac380d8d9f56d27 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 16:37:00 -0700 Subject: [PATCH 20/34] More debugging to find out why artifact sharing between my workflows is not working. --- .github/workflows/build.yml | 12 +++++++++--- .github/workflows/ci.yml | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 69f5c08..7df7c22 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,11 +120,18 @@ jobs: chmod +x $binary $binary --version + - name: Get Workflow ID for ci.yml + id: get_workflow_id + run: | + curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ + | jq -r '.workflows[] | select(.path == ".github/workflows/ci.yml") | .id' + - name: Get latest successful run id for ci.yml id: get_run_id run: | curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows/ci.yml/runs?status=success&branch=master" \ + "https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ steps.get_workflow_id.outputs.workflow-id }}/runs?status=success&branch=master" \ | jq -r '.workflow_runs[0].id' - name: Echo the run-id @@ -136,8 +143,7 @@ jobs: uses: actions/download-artifact@v4 with: name: coverage-report - path: test/ - repository: coverallsapp/coverage-reporter + path: ./test/ run-id: ${{ steps.get_run_id.outputs.run-id }} github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04b2904..6677b74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,4 +81,10 @@ jobs: - name: Debug uploaded artifact run: | echo "Artifact URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/" + + - name: Display Workflow ID + run: | + curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ + | jq '.workflows[] | select(.name == "ci") | .id' \ No newline at end of file From 4ba2801502cbdf83fcbd6c94ccd9da10e6b33a65 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 16:58:15 -0700 Subject: [PATCH 21/34] Try dawidd6/action-download-artifact@v3 action instead of actions/download-artifact@v4. --- .github/workflows/build.yml | 27 ++++++++++++++++++++------- .github/workflows/ci.yml | 15 +++++++++++++++ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7df7c22..f75827f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -138,14 +138,28 @@ jobs: run: | echo "Run ID: ${{ steps.get_run_id.outputs.run-id }}" - # Download the coverage report generated from ci.yml - - name: Download coverage report - uses: actions/download-artifact@v4 + - name: Download latest coverage summary + uses: dawidd6/action-download-artifact@v3 with: - name: coverage-report + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: ci.yml + name: coverage-summary path: ./test/ - run-id: ${{ steps.get_run_id.outputs.run-id }} - github-token: ${{ secrets.GITHUB_TOKEN }} + search_artifacts: true + check_artifacts: true + if_no_artifact_found: warn + + - name: Display coverage summary + run: cat ./test/coverage_summary.txt + + # # Download the coverage report generated from ci.yml + # - name: Download coverage report + # uses: actions/download-artifact@v4 + # with: + # name: coverage-report + # path: ./test/ + # run-id: ${{ steps.get_run_id.outputs.run-id }} + # github-token: ${{ secrets.GITHUB_TOKEN }} # Report coverage with x86_64 binary - name: Test reporting coverage with x86_64 binary @@ -153,7 +167,6 @@ jobs: COVERALLS_REPO_TOKEN: ${{ github.token }} run: | binary=test/coveralls-linux-x86_64 - cd coverage COVERALLS_SERVICE_NUMBER=${{ github.run_id }}-x86_64-test $binary report --measure --base-path src/coverage_reporter/ test-linux-aarch64: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6677b74..46529b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,21 @@ jobs: with: name: coverage-report path: coverage/ + retention-days: 5 + + - name: Create coverage summary + run: | + echo "Coverage Summary" > coverage_summary.txt + echo "Date: $(date)" >> coverage_summary.txt + echo "Commit: ${{ github.sha }}" >> coverage_summary.txt + # Add more relevant info from your coverage report + + - name: Upload coverage summary + uses: actions/upload-artifact@v4 + with: + name: coverage-summary + path: coverage_summary.txt + retention-days: 5 - name: List uploaded artifacts run: ls -la coverage/ From 605efaab54cd5b98987ce90876d30d2d720f4a43 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 17:04:58 -0700 Subject: [PATCH 22/34] Fix the branch. It should be the PR branch, not master. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f75827f..12070b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -131,7 +131,7 @@ jobs: id: get_run_id run: | curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ steps.get_workflow_id.outputs.workflow-id }}/runs?status=success&branch=master" \ + "https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ steps.get_workflow_id.outputs.workflow-id }}/runs?status=success&branch=${{ github.head_ref }}" \ | jq -r '.workflow_runs[0].id' - name: Echo the run-id From edb3ddaca3317fe33fd288111695631cc0aa9f74 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Mon, 30 Sep 2024 17:19:47 -0700 Subject: [PATCH 23/34] The dawidd6/action-download-artifact@v3 approach worked, so extend it to the test-linux-aarch64 job. --- .github/workflows/build.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12070b1..c0541ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,7 +167,7 @@ jobs: COVERALLS_REPO_TOKEN: ${{ github.token }} run: | binary=test/coveralls-linux-x86_64 - COVERALLS_SERVICE_NUMBER=${{ github.run_id }}-x86_64-test $binary report --measure --base-path src/coverage_reporter/ + COVERALLS_SERVICE_NUMBER=x86_64-test-${{ github.run_id }} $binary report --measure --base-path src/coverage_reporter/ test-linux-aarch64: runs-on: ubuntu-latest @@ -191,6 +191,27 @@ jobs: sudo apt-get install -y qemu-user qemu-aarch64 $binary --version + - name: Download latest coverage summary + uses: dawidd6/action-download-artifact@v3 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: ci.yml + name: coverage-summary + path: ./test/ + search_artifacts: true + check_artifacts: true + if_no_artifact_found: warn + + - name: Display coverage summary + run: cat ./test/coverage_summary.txt + + - name: Report coverage with aarch64 binary + env: + COVERALLS_REPO_TOKEN: ${{ github.token }} + run: | + binary=test/coveralls-linux-aarch64 + COVERALLS_SERVICE_NUMBER=aarch64-test-${{ github.run_id }} qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ + # # Download the coverage report generated from ci.yml # - name: Download coverage report # uses: actions/download-artifact@v4 From e898eaefde5935d45d41a551c1dbc9500117c0b1 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 09:03:16 -0700 Subject: [PATCH 24/34] Try dawidd6/action-download-artifact@v3 with coevrage-report. --- .github/workflows/build.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0541ce..90ea9e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,7 +167,7 @@ jobs: COVERALLS_REPO_TOKEN: ${{ github.token }} run: | binary=test/coveralls-linux-x86_64 - COVERALLS_SERVICE_NUMBER=x86_64-test-${{ github.run_id }} $binary report --measure --base-path src/coverage_reporter/ + COVERALLS_SERVICE_NUMBER=rc-x86_64-${{ github.run_id }} $binary report --measure --base-path src/coverage_reporter/ test-linux-aarch64: runs-on: ubuntu-latest @@ -210,14 +210,22 @@ jobs: COVERALLS_REPO_TOKEN: ${{ github.token }} run: | binary=test/coveralls-linux-aarch64 - COVERALLS_SERVICE_NUMBER=aarch64-test-${{ github.run_id }} qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ + COVERALLS_SERVICE_NUMBER=rc-aarch64-${{ github.run_id }} qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ # # Download the coverage report generated from ci.yml - # - name: Download coverage report - # uses: actions/download-artifact@v4 - # with: - # name: coverage-report - # path: ./coverage/ + - name: Download latest coverage summary + uses: dawidd6/action-download-artifact@v3 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: ci.yml + name: coverage-report + path: ./test/ + search_artifacts: true + check_artifacts: true + if_no_artifact_found: warn + + - name: List files in test/ directory + run: ls -al ./test/ # # Report coverage with aarch64 binary # - name: Report coverage with aarch64 binary From fad578b3fb4fe37a465c712f8cb54d8d827d2a8b Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 09:30:44 -0700 Subject: [PATCH 25/34] Add further debug steps to understand where coverage-report from ci.yml is being uploaded. --- .github/workflows/build.yml | 30 +++++++++++++++--------------- .github/workflows/ci.yml | 6 ++++++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90ea9e5..6c67f08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -152,6 +152,21 @@ jobs: - name: Display coverage summary run: cat ./test/coverage_summary.txt + # # Download the coverage report generated from ci.yml + - name: Download latest coverage summary + uses: dawidd6/action-download-artifact@v3 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: ci.yml + name: coverage-report + path: ./test/ + search_artifacts: true + check_artifacts: true + if_no_artifact_found: warn + + - name: List files in ./test/ directory + run: ls -al ./test/ + # # Download the coverage report generated from ci.yml # - name: Download coverage report # uses: actions/download-artifact@v4 @@ -212,21 +227,6 @@ jobs: binary=test/coveralls-linux-aarch64 COVERALLS_SERVICE_NUMBER=rc-aarch64-${{ github.run_id }} qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ - # # Download the coverage report generated from ci.yml - - name: Download latest coverage summary - uses: dawidd6/action-download-artifact@v3 - with: - github_token: ${{secrets.GITHUB_TOKEN}} - workflow: ci.yml - name: coverage-report - path: ./test/ - search_artifacts: true - check_artifacts: true - if_no_artifact_found: warn - - - name: List files in test/ directory - run: ls -al ./test/ - # # Report coverage with aarch64 binary # - name: Report coverage with aarch64 binary # env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46529b5..9d1a2e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,12 @@ jobs: cd coverage ../bin/coveralls report --measure --base-path src/coverage_reporter/ + - name: List contents of coverage/ directory + run: ls -la coverage/ + + - name: List contents of coverage/ directory + run: ls -la ${{ github.workspace }}/coverage/ + - name: Upload coverage report uses: actions/upload-artifact@v4 with: From 3c539302d4fa2c8ee8fd1c2c4ddceb8071d5b9d6 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 10:35:09 -0700 Subject: [PATCH 26/34] Try to capture filename of coverage report. --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d1a2e8..e0e9f8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,11 @@ jobs: - name: Generate coverage run: bin/crkcov --kcov-args --exclude-pattern=/usr/include,/usr/lib,lib/,spec/ --coverage-dir ${{ github.workspace }}/coverage + - name: Capture and export coverage report file as variable + run: | + COVERAGE_FILE=$(find ${{ github.workspace }}/coverage -name "*.*") + echo "COVERAGE_FILE=$COVERAGE_FILE" >> $GITHUB_ENV + - name: Report coverage env: COVERALLS_REPO_TOKEN: ${{ github.token }} @@ -79,8 +84,8 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage-report - path: coverage/ - retention-days: 5 + path: ${{ env.COVERAGE_FILE }} + retention-days: 5 - name: Create coverage summary run: | From a1efe1d9955d1617cdf67cb17dc75ceaadd7d05d Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 10:38:44 -0700 Subject: [PATCH 27/34] Try to capture filename of coverage report. Fix syntax. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0e9f8a..4944cf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: - name: Capture and export coverage report file as variable run: | - COVERAGE_FILE=$(find ${{ github.workspace }}/coverage -name "*.*") + COVERAGE_FILE=$(find ${{ github.workspace }}/coverage -name "*.xml" | grep cobertura.xml) echo "COVERAGE_FILE=$COVERAGE_FILE" >> $GITHUB_ENV - name: Report coverage From c98bc7feb8c7ae52f3d665ec78486e64d4191494 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 10:53:45 -0700 Subject: [PATCH 28/34] Start cleaning up... --- .github/workflows/build.yml | 72 +++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c67f08..9e75a54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,23 +120,23 @@ jobs: chmod +x $binary $binary --version - - name: Get Workflow ID for ci.yml - id: get_workflow_id - run: | - curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ - | jq -r '.workflows[] | select(.path == ".github/workflows/ci.yml") | .id' + # - name: Get Workflow ID for ci.yml + # id: get_workflow_id + # run: | + # curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + # "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ + # | jq -r '.workflows[] | select(.path == ".github/workflows/ci.yml") | .id' - - name: Get latest successful run id for ci.yml - id: get_run_id - run: | - curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ steps.get_workflow_id.outputs.workflow-id }}/runs?status=success&branch=${{ github.head_ref }}" \ - | jq -r '.workflow_runs[0].id' + # - name: Get latest successful run id for ci.yml + # id: get_run_id + # run: | + # curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + # "https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ steps.get_workflow_id.outputs.workflow-id }}/runs?status=success&branch=${{ github.head_ref }}" \ + # | jq -r '.workflow_runs[0].id' - - name: Echo the run-id - run: | - echo "Run ID: ${{ steps.get_run_id.outputs.run-id }}" + # - name: Echo the run-id + # run: | + # echo "Run ID: ${{ steps.get_run_id.outputs.run-id }}" - name: Download latest coverage summary uses: dawidd6/action-download-artifact@v3 @@ -144,40 +144,30 @@ jobs: github_token: ${{secrets.GITHUB_TOKEN}} workflow: ci.yml name: coverage-summary - path: ./test/ + path: ./coverage/ search_artifacts: true check_artifacts: true if_no_artifact_found: warn - name: Display coverage summary - run: cat ./test/coverage_summary.txt + run: cat ./coverage/coverage_summary.txt - # # Download the coverage report generated from ci.yml - - name: Download latest coverage summary + # Download the coverage report generated from ci.yml + - name: Download latest coverage report for coverage-reporter from ci.yml uses: dawidd6/action-download-artifact@v3 with: github_token: ${{secrets.GITHUB_TOKEN}} workflow: ci.yml name: coverage-report - path: ./test/ + path: ./coverage/ search_artifacts: true check_artifacts: true if_no_artifact_found: warn - - name: List files in ./test/ directory - run: ls -al ./test/ + - name: List files in ./coverage/ directory + run: ls -al ./coverage/ - # # Download the coverage report generated from ci.yml - # - name: Download coverage report - # uses: actions/download-artifact@v4 - # with: - # name: coverage-report - # path: ./test/ - # run-id: ${{ steps.get_run_id.outputs.run-id }} - # github-token: ${{ secrets.GITHUB_TOKEN }} - - # Report coverage with x86_64 binary - - name: Test reporting coverage with x86_64 binary + - name: Report coverage with x86_64 binary env: COVERALLS_REPO_TOKEN: ${{ github.token }} run: | @@ -212,13 +202,25 @@ jobs: github_token: ${{secrets.GITHUB_TOKEN}} workflow: ci.yml name: coverage-summary - path: ./test/ + path: ./coverage/ search_artifacts: true check_artifacts: true if_no_artifact_found: warn - name: Display coverage summary - run: cat ./test/coverage_summary.txt + run: cat ./coverage/coverage_summary.txt + + # Download the coverage report generated from ci.yml + - name: Download latest coverage report for coverage-reporter from ci.yml + uses: dawidd6/action-download-artifact@v3 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + workflow: ci.yml + name: coverage-report + path: ./coverage/ + search_artifacts: true + check_artifacts: true + if_no_artifact_found: warn - name: Report coverage with aarch64 binary env: From c3d4aafc099e0ab8c00f547efcb80fd378db933a Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 11:13:01 -0700 Subject: [PATCH 29/34] Continue cleanup... --- .github/workflows/build.yml | 62 +++++++++++-------------------------- 1 file changed, 18 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e75a54..de1eb60 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,24 +119,6 @@ jobs: echo $binary chmod +x $binary $binary --version - - # - name: Get Workflow ID for ci.yml - # id: get_workflow_id - # run: | - # curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - # "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ - # | jq -r '.workflows[] | select(.path == ".github/workflows/ci.yml") | .id' - - # - name: Get latest successful run id for ci.yml - # id: get_run_id - # run: | - # curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - # "https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ steps.get_workflow_id.outputs.workflow-id }}/runs?status=success&branch=${{ github.head_ref }}" \ - # | jq -r '.workflow_runs[0].id' - - # - name: Echo the run-id - # run: | - # echo "Run ID: ${{ steps.get_run_id.outputs.run-id }}" - name: Download latest coverage summary uses: dawidd6/action-download-artifact@v3 @@ -151,8 +133,7 @@ jobs: - name: Display coverage summary run: cat ./coverage/coverage_summary.txt - - # Download the coverage report generated from ci.yml + - name: Download latest coverage report for coverage-reporter from ci.yml uses: dawidd6/action-download-artifact@v3 with: @@ -164,6 +145,9 @@ jobs: check_artifacts: true if_no_artifact_found: warn + - name: List files in ./test/ directory + run: ls -al ./test/ + - name: List files in ./coverage/ directory run: ls -al ./coverage/ @@ -196,21 +180,20 @@ jobs: sudo apt-get install -y qemu-user qemu-aarch64 $binary --version - - name: Download latest coverage summary - uses: dawidd6/action-download-artifact@v3 - with: - github_token: ${{secrets.GITHUB_TOKEN}} - workflow: ci.yml - name: coverage-summary - path: ./coverage/ - search_artifacts: true - check_artifacts: true - if_no_artifact_found: warn - - - name: Display coverage summary - run: cat ./coverage/coverage_summary.txt - - # Download the coverage report generated from ci.yml + # - name: Download latest coverage summary + # uses: dawidd6/action-download-artifact@v3 + # with: + # github_token: ${{secrets.GITHUB_TOKEN}} + # workflow: ci.yml + # name: coverage-summary + # path: ./coverage/ + # search_artifacts: true + # check_artifacts: true + # if_no_artifact_found: warn + + # - name: Display coverage summary + # run: cat ./coverage/coverage_summary.txt + - name: Download latest coverage report for coverage-reporter from ci.yml uses: dawidd6/action-download-artifact@v3 with: @@ -229,15 +212,6 @@ jobs: binary=test/coveralls-linux-aarch64 COVERALLS_SERVICE_NUMBER=rc-aarch64-${{ github.run_id }} qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ - # # Report coverage with aarch64 binary - # - name: Report coverage with aarch64 binary - # env: - # COVERALLS_REPO_TOKEN: ${{ github.token }} - # run: | - # binary=test/coveralls-linux-aarch64 - # cd coverage - # qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/ - release: runs-on: ubuntu-latest needs: [build-windows, build-linux] From 578be6ee442773d406c7c21bbc87044369d7a570 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 11:33:23 -0700 Subject: [PATCH 30/34] Further cleanup... --- .github/workflows/build.yml | 46 +++++++++++++------------------------ .github/workflows/ci.yml | 45 +++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de1eb60..ac7ac24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,19 +120,19 @@ jobs: chmod +x $binary $binary --version - - name: Download latest coverage summary - uses: dawidd6/action-download-artifact@v3 - with: - github_token: ${{secrets.GITHUB_TOKEN}} - workflow: ci.yml - name: coverage-summary - path: ./coverage/ - search_artifacts: true - check_artifacts: true - if_no_artifact_found: warn + # - name: Download latest coverage summary + # uses: dawidd6/action-download-artifact@v3 + # with: + # github_token: ${{secrets.GITHUB_TOKEN}} + # workflow: ci.yml + # name: coverage-summary + # path: ./coverage/ + # search_artifacts: true + # check_artifacts: true + # if_no_artifact_found: warn - - name: Display coverage summary - run: cat ./coverage/coverage_summary.txt + # - name: Display coverage summary + # run: cat ./coverage/coverage_summary.txt - name: Download latest coverage report for coverage-reporter from ci.yml uses: dawidd6/action-download-artifact@v3 @@ -145,11 +145,11 @@ jobs: check_artifacts: true if_no_artifact_found: warn - - name: List files in ./test/ directory - run: ls -al ./test/ + # - name: List files in ./test/ directory + # run: ls -al ./test/ - - name: List files in ./coverage/ directory - run: ls -al ./coverage/ + # - name: List files in ./coverage/ directory + # run: ls -al ./coverage/ - name: Report coverage with x86_64 binary env: @@ -179,20 +179,6 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-user qemu-aarch64 $binary --version - - # - name: Download latest coverage summary - # uses: dawidd6/action-download-artifact@v3 - # with: - # github_token: ${{secrets.GITHUB_TOKEN}} - # workflow: ci.yml - # name: coverage-summary - # path: ./coverage/ - # search_artifacts: true - # check_artifacts: true - # if_no_artifact_found: warn - - # - name: Display coverage summary - # run: cat ./coverage/coverage_summary.txt - name: Download latest coverage report for coverage-reporter from ci.yml uses: dawidd6/action-download-artifact@v3 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4944cf8..6210deb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: ../bin/coveralls report --measure --base-path src/coverage_reporter/ - name: List contents of coverage/ directory - run: ls -la coverage/ + run: ls -la ./coverage/ - name: List contents of coverage/ directory run: ls -la ${{ github.workspace }}/coverage/ @@ -87,30 +87,33 @@ jobs: path: ${{ env.COVERAGE_FILE }} retention-days: 5 - - name: Create coverage summary - run: | - echo "Coverage Summary" > coverage_summary.txt - echo "Date: $(date)" >> coverage_summary.txt - echo "Commit: ${{ github.sha }}" >> coverage_summary.txt - # Add more relevant info from your coverage report + # - name: Create coverage summary + # run: | + # echo "Coverage Summary" > coverage_summary.txt + # echo "Date: $(date)" >> coverage_summary.txt + # echo "Commit: ${{ github.sha }}" >> coverage_summary.txt + # # Add more relevant info from your coverage report - - name: Upload coverage summary - uses: actions/upload-artifact@v4 - with: - name: coverage-summary - path: coverage_summary.txt - retention-days: 5 + # - name: Upload coverage summary + # uses: actions/upload-artifact@v4 + # with: + # name: coverage-summary + # path: coverage_summary.txt + # retention-days: 5 - - name: List uploaded artifacts - run: ls -la coverage/ + - name: List contents of coverage/ directory + run: ls -la ./coverage/ - - name: Debug uploaded artifact + - name: List contents of coverage/ directory + run: ls -la ${{ github.workspace }}/coverage/ + + - name: Debug uploaded artifact (REST API) run: | echo "Artifact URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/" - - name: Display Workflow ID - run: | - curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ - | jq '.workflows[] | select(.name == "ci") | .id' + # - name: Display Workflow ID + # run: | + # curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + # "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ + # | jq '.workflows[] | select(.name == "ci") | .id' \ No newline at end of file From 2c8d25231e9ca31229cbe7afc0f5d7ca713f8171 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 12:14:22 -0700 Subject: [PATCH 31/34] More cleanup... --- .github/workflows/build.yml | 20 ------------------ .github/workflows/ci.yml | 41 +++++-------------------------------- 2 files changed, 5 insertions(+), 56 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac7ac24..c7f1c3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,20 +119,6 @@ jobs: echo $binary chmod +x $binary $binary --version - - # - name: Download latest coverage summary - # uses: dawidd6/action-download-artifact@v3 - # with: - # github_token: ${{secrets.GITHUB_TOKEN}} - # workflow: ci.yml - # name: coverage-summary - # path: ./coverage/ - # search_artifacts: true - # check_artifacts: true - # if_no_artifact_found: warn - - # - name: Display coverage summary - # run: cat ./coverage/coverage_summary.txt - name: Download latest coverage report for coverage-reporter from ci.yml uses: dawidd6/action-download-artifact@v3 @@ -145,12 +131,6 @@ jobs: check_artifacts: true if_no_artifact_found: warn - # - name: List files in ./test/ directory - # run: ls -al ./test/ - - # - name: List files in ./coverage/ directory - # run: ls -al ./coverage/ - - name: Report coverage with x86_64 binary env: COVERALLS_REPO_TOKEN: ${{ github.token }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6210deb..13e2406 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,11 +62,6 @@ jobs: - name: Generate coverage run: bin/crkcov --kcov-args --exclude-pattern=/usr/include,/usr/lib,lib/,spec/ --coverage-dir ${{ github.workspace }}/coverage - - name: Capture and export coverage report file as variable - run: | - COVERAGE_FILE=$(find ${{ github.workspace }}/coverage -name "*.xml" | grep cobertura.xml) - echo "COVERAGE_FILE=$COVERAGE_FILE" >> $GITHUB_ENV - - name: Report coverage env: COVERALLS_REPO_TOKEN: ${{ github.token }} @@ -74,11 +69,11 @@ jobs: cd coverage ../bin/coveralls report --measure --base-path src/coverage_reporter/ - - name: List contents of coverage/ directory - run: ls -la ./coverage/ - - - name: List contents of coverage/ directory - run: ls -la ${{ github.workspace }}/coverage/ + - name: Capture and export coverage report file as env variable + run: | + COVERAGE_FILE=$(find ${{ github.workspace }}/coverage -name "*.xml" | grep cobertura.xml) + echo "Found coverage file(s): $COVERAGE_FILE" + echo "COVERAGE_FILE=$COVERAGE_FILE" >> $GITHUB_ENV - name: Upload coverage report uses: actions/upload-artifact@v4 @@ -87,33 +82,7 @@ jobs: path: ${{ env.COVERAGE_FILE }} retention-days: 5 - # - name: Create coverage summary - # run: | - # echo "Coverage Summary" > coverage_summary.txt - # echo "Date: $(date)" >> coverage_summary.txt - # echo "Commit: ${{ github.sha }}" >> coverage_summary.txt - # # Add more relevant info from your coverage report - - # - name: Upload coverage summary - # uses: actions/upload-artifact@v4 - # with: - # name: coverage-summary - # path: coverage_summary.txt - # retention-days: 5 - - - name: List contents of coverage/ directory - run: ls -la ./coverage/ - - - name: List contents of coverage/ directory - run: ls -la ${{ github.workspace }}/coverage/ - - name: Debug uploaded artifact (REST API) run: | echo "Artifact URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/" - - # - name: Display Workflow ID - # run: | - # curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - # "https://api.github.com/repos/${{ github.repository }}/actions/workflows" \ - # | jq '.workflows[] | select(.name == "ci") | .id' \ No newline at end of file From bcf03a78a3cf6c07570453ace75ef058a2062a49 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 12:23:23 -0700 Subject: [PATCH 32/34] Final cleanup of workflows. --- .github/workflows/build.yml | 2 +- .github/workflows/ci.yml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7f1c3e..78568a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,7 +151,7 @@ jobs: name: coveralls-linux-binaries path: test/ - - name: Smoke test aarch64 binary in QEMU + - name: Smoke test aarch64 binary run: | binary=test/coveralls-linux-aarch64 echo $binary diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13e2406..92a3973 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,8 +81,4 @@ jobs: name: coverage-report path: ${{ env.COVERAGE_FILE }} retention-days: 5 - - - name: Debug uploaded artifact (REST API) - run: | - echo "Artifact URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/" \ No newline at end of file From 7f783a296d16425cf5db431b0cc920e6225ca274 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 12:25:54 -0700 Subject: [PATCH 33/34] Remove separate workflows created to test binaries that are triggered by workflow_run and only run in the default branch.. --- .github/workflows/test-binaries-qemu.yml | 65 ------------------ .github/workflows/test-binaries.yml | 75 --------------------- .github/workflows/test-trigger-workflow.yml | 13 ---- 3 files changed, 153 deletions(-) delete mode 100644 .github/workflows/test-binaries-qemu.yml delete mode 100644 .github/workflows/test-binaries.yml delete mode 100644 .github/workflows/test-trigger-workflow.yml diff --git a/.github/workflows/test-binaries-qemu.yml b/.github/workflows/test-binaries-qemu.yml deleted file mode 100644 index 910812d..0000000 --- a/.github/workflows/test-binaries-qemu.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: test-binaries-qemu - -permissions: - contents: read - actions: read - -on: - workflow_run: - workflows: [build] - types: - - completed - -jobs: - test-x86_64: - runs-on: ubuntu-22.04 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - 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.event.workflow_run.id }}/artifacts" | jq '.artifacts[] | .name' - - name: Download coveralls-linux-x86_64 binary - uses: actions/download-artifact@v4 - with: - run-id: ${{ github.event.workflow_run.id }} - name: coveralls-linux-x86_64 - 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.event.workflow_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: - run-id: ${{ github.event.workflow_run.id }} - name: coveralls-linux-aarch64 - 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 deleted file mode 100644 index a9709df..0000000 --- a/.github/workflows/test-binaries.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: test-binaries - -permissions: - contents: read - actions: read - -on: - workflow_run: - workflows: [build] - types: - - completed - -jobs: - test_binaries: - name: Test Multi-Arch Binaries - runs-on: ubuntu-22.04 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - strategy: - matrix: - arch: [x86_64, aarch64] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - # 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.event.workflow_run.id }}/artifacts" | jq '.artifacts[] | .name' - - # - name: Download built artifacts (linux binaries) - # uses: actions/download-artifact@v4 - # with: - # run-id: ${{ github.event.workflow_run.id }} - # name: coveralls-linux-binaries - # path: ./binaries/ - - - name: Download built x86_64 binary - uses: actions/download-artifact@v4 - with: - run-id: ${{ github.event.workflow_run.id }} - name: coveralls-windows.exe - path: ./binaries/ - - - name: Download built aarch64 binary - uses: actions/download-artifact@v4 - with: - run-id: ${{ github.event.workflow_run.id }} - name: coveralls-windows.exe - path: ./binaries/ - - # Debug step to list available artifacts - - name: List available artifacts in ./binaries/ - run: ls -la ./binaries/ - - - name: Download coverage report - uses: actions/download-artifact@v4 - with: - name: coverage-report # Assuming this is the name of the artifact from the build.yml run - path: ./coverage/ - - # Run the binary inside a Docker container with the correct architecture - - name: Test Binary in Architecture-Specific Docker Container - run: | - if [ "${{ matrix.arch }}" = "x86_64" ]; then - make ubuntu-x86_64 && ./binaries/coveralls-linux-x86_64 report --measure --base-path src/coverage_reporter/; - elif [ "${{ matrix.arch }}" = "aarch64" ]; then - make ubuntu-aarch64 && ./binaries/coveralls-linux-aarch64 report --measure --base-path src/coverage_reporter/; - fi - env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} diff --git a/.github/workflows/test-trigger-workflow.yml b/.github/workflows/test-trigger-workflow.yml deleted file mode 100644 index d4359e0..0000000 --- a/.github/workflows/test-trigger-workflow.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: test-trigger-workflow - -on: - workflow_run: - workflows: [build] - types: - - completed - -jobs: - test: - runs-on: ubuntu-latest - steps: - - run: echo "Trigger worked" From 67b669341dbd43a170bee4af307cc22ca0421192 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Tue, 1 Oct 2024 12:35:10 -0700 Subject: [PATCH 34/34] Last of cleanup: we don't need to checkout the code in the test steps because we're just downloading the binaries like customers will when they use them. We aren't building anything. --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78568a2..9f9a532 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,8 +104,8 @@ jobs: runs-on: ubuntu-latest needs: build-linux steps: - - name: Checkout code - uses: actions/checkout@v4 + # - name: Checkout code + # uses: actions/checkout@v4 - name: Download x86_64 binary uses: actions/download-artifact@v4 @@ -142,8 +142,8 @@ jobs: runs-on: ubuntu-latest needs: build-linux steps: - - name: Checkout code - uses: actions/checkout@v4 + # - name: Checkout code + # uses: actions/checkout@v4 - name: Download aarch64 binary uses: actions/download-artifact@v4