Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Linux Binaries after they're built in CI (Cont'd) #162

Merged
merged 34 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9eee04a
Trigger CI.
afinetooth Sep 27, 2024
199d3c3
Fix duplicate key (permissions:) in build.yml.
afinetooth Sep 27, 2024
ea5f812
Try adding test jobs to build.yml workflow after build-linux job.
afinetooth Sep 30, 2024
29357df
Fix syntax error in build.yml.
afinetooth Sep 30, 2024
027cd43
Give executable permissions to binaries.
afinetooth Sep 30, 2024
80be041
Obtain test binaries as outputs from the previous step rather than up…
afinetooth Sep 30, 2024
939ee20
Fix issues with referencing binaries as outputs from a previous step.
afinetooth Sep 30, 2024
4d70c91
Move setting of outputs to the Package linux binaries step of the bui…
afinetooth Sep 30, 2024
3ab35cd
Add debug steps to find out why test-* jobs aren't finding the binari…
afinetooth Sep 30, 2024
36a21df
Fix output declaration in build-linux job, and output references in t…
afinetooth Sep 30, 2024
214c767
Fix output declaration in build-linux job, and output references in t…
afinetooth Sep 30, 2024
6583ab6
Switch back to using artifacts between jobs because of failures with …
afinetooth Sep 30, 2024
2c3e79d
Remove remnants of previous outputs solution. Drop remaining debug st…
afinetooth Sep 30, 2024
5a18922
Test reporting coverage with x86_64 binary.
afinetooth Sep 30, 2024
acb3a8c
Uncomment upload step in ci.yml (duh), and use the COVERALLS_SERVICE_…
afinetooth Sep 30, 2024
1450708
Fix error in github actions env var syntax.
afinetooth Sep 30, 2024
fd854ad
Add debug step to make sure coverage report is uploaded as artifact.
afinetooth Sep 30, 2024
b54270f
Fix syntax error in ci.yml. Try to use new attributes for cross-workf…
afinetooth Sep 30, 2024
2695fc7
Change the way run id is referenced in download step. Add more debugg…
afinetooth Sep 30, 2024
84fba76
More debugging to find out why artifact sharing between my workflows …
afinetooth Sep 30, 2024
4ba2801
Try dawidd6/action-download-artifact@v3 action instead of actions/dow…
afinetooth Sep 30, 2024
605efaa
Fix the branch. It should be the PR branch, not master.
afinetooth Oct 1, 2024
edb3dda
The dawidd6/action-download-artifact@v3 approach worked, so extend it…
afinetooth Oct 1, 2024
e898eae
Try dawidd6/action-download-artifact@v3 with coevrage-report.
afinetooth Oct 1, 2024
fad578b
Add further debug steps to understand where coverage-report from ci.y…
afinetooth Oct 1, 2024
3c53930
Try to capture filename of coverage report.
afinetooth Oct 1, 2024
a1efe1d
Try to capture filename of coverage report. Fix syntax.
afinetooth Oct 1, 2024
c98bc7f
Start cleaning up...
afinetooth Oct 1, 2024
c3d4aaf
Continue cleanup...
afinetooth Oct 1, 2024
578be6e
Further cleanup...
afinetooth Oct 1, 2024
2c8d252
More cleanup...
afinetooth Oct 1, 2024
bcf03a7
Final cleanup of workflows.
afinetooth Oct 1, 2024
7f783a2
Remove separate workflows created to test binaries that are triggered…
afinetooth Oct 1, 2024
67b6693
Last of cleanup: we don't need to checkout the code in the test steps…
afinetooth Oct 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 76 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
tags:
- 'v*'

permissions:
contents: write

jobs:
build-windows:
runs-on: windows-2022
Expand Down Expand Up @@ -74,11 +71,6 @@ jobs:
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

Expand All @@ -94,70 +86,97 @@ jobs:
run: make build-xbuild-container

- name: Build cross-compiled linux binaries
id: build
run: make compile-and-strip-all

- name: Package linux binaries
id: package
run: make package

# 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
with:
name: coveralls-linux-binaries
path: dist/*
if-no-files-found: error

- name: Create Trigger File
run: echo "test-binaries-trigger" > test-binaries-trigger.txt
test-linux-x86_64:
runs-on: ubuntu-latest
needs: build-linux
steps:
# - name: Checkout code
# uses: actions/checkout@v4

- name: Upload Trigger Artifact
uses: actions/upload-artifact@v4
- name: Download x86_64 binary
uses: actions/download-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
name: coveralls-linux-binaries
path: test/

- name: Smoke test x86_64 binary
run: |
binary=test/coveralls-linux-x86_64
echo $binary
chmod +x $binary
$binary --version

- name: Download latest coverage report for coverage-reporter from ci.yml
uses: dawidd6/action-download-artifact@v3
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
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 x86_64 binary
env:
COVERALLS_REPO_TOKEN: ${{ github.token }}
run: |
binary=test/coveralls-linux-x86_64
COVERALLS_SERVICE_NUMBER=rc-x86_64-${{ github.run_id }} $binary report --measure --base-path src/coverage_reporter/

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-binaries
path: test/

- name: Smoke test aarch64 binary
run: |
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

- name: Download latest coverage report for coverage-reporter from ci.yml
uses: dawidd6/action-download-artifact@v3
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/
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:
COVERALLS_REPO_TOKEN: ${{ github.token }}
run: |
binary=test/coveralls-linux-aarch64
COVERALLS_SERVICE_NUMBER=rc-aarch64-${{ github.run_id }} qemu-aarch64 $binary report --measure --base-path src/coverage_reporter/

release:
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,17 @@ jobs:
run: |
cd coverage
../bin/coveralls report --measure --base-path src/coverage_reporter/

- 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
with:
name: coverage-report
path: ${{ env.COVERAGE_FILE }}
retention-days: 5

65 changes: 0 additions & 65 deletions .github/workflows/test-binaries-qemu.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/test-binaries.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/test-trigger-workflow.yml

This file was deleted.