Skip to content

Commit

Permalink
Fix issues with referencing binaries as outputs from a previous step.
Browse files Browse the repository at this point in the history
  • Loading branch information
afinetooth committed Sep 30, 2024
1 parent 80be041 commit 939ee20
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 24 deletions.
61 changes: 37 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -119,41 +120,44 @@ 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
steps:
- 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 }}
Expand All @@ -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]
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 939ee20

Please sign in to comment.