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

Add an aarch64 linux binary to all new releases #152

Merged
merged 21 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c3a3187
First working version for this approach.
afinetooth Sep 11, 2024
8af2fac
WIP commit. Near finished, just comments and cleanup remaining.
afinetooth Sep 18, 2024
0733740
Change names back to match those in ci.yml.
afinetooth Sep 19, 2024
af9fa19
Add flag to zig cc to suppress warning we can't do anything about.
afinetooth Sep 19, 2024
4e96aee
Add step to install production dependencies with shards install.
afinetooth Sep 19, 2024
4e005e4
Bump crystal version to 1.13.2.
afinetooth Sep 19, 2024
6235672
Disable verbosity.
afinetooth Sep 19, 2024
878ade2
Cleanup / remove some unused code.
afinetooth Sep 19, 2024
6b21f2f
Switch to zig cc --strip-all for aarch64 due to Ci errors. Cleanup / …
afinetooth Sep 19, 2024
142ff2d
Run all containers as the local user to avoid permissions issues.
afinetooth Sep 19, 2024
0ea6c5f
Fix code style issues per Codacy.
afinetooth Sep 19, 2024
700abb1
Run compile and strip steps as root.
afinetooth Sep 19, 2024
9eac84d
Fix error caused by overzealous codacy recommendations (to double-quo…
afinetooth Sep 19, 2024
2dd37ae
Run both commands inside the containers for each strip target: && .
afinetooth Sep 19, 2024
a8fddb8
Clean up code and add comments to help contributors.
afinetooth Sep 19, 2024
d1586ac
Remove leftover binary from local testing.
afinetooth Sep 19, 2024
b710a5b
Don't upload linux binaries into a containing folder.
afinetooth Sep 19, 2024
aea65c4
Upload each linux binary separately (for now) so I can test them befo…
afinetooth Sep 19, 2024
dc4cc9e
Add workflow to test multi-arch binaries after their built.
afinetooth Sep 20, 2024
cf74000
Clean up workflows. Modify test-binaries workflow.
afinetooth Sep 20, 2024
663c643
Rename arch-specific Ubunutu container targets in Makefile; reuse Mak…
afinetooth Sep 20, 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
80 changes: 66 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.1
crystal: 1.13.2

- name: Build SQLite3 static library
run: "scripts/sqlite3-static.ps1"
Expand Down Expand Up @@ -72,24 +72,71 @@ jobs:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.1
crystal: 1.13.2

- name: Build (Linux)
run: make release_linux
- name: Install shards dependencies
run: shards install --production

- name: Build cross-compilation container
run: make build-xbuild-container

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

- name: Upload binary
- name: Package linux binaries
run: make package

- name: Upload linux binaries
uses: actions/upload-artifact@v3
with:
name: coveralls-linux
path: dist/coveralls
name: coveralls-linux-binaries
path: dist/*
if-no-files-found: error

- name: Upload tar.gz
- name: Create Trigger File
run: echo "test-binaries-trigger" > test-binaries-trigger.txt

- name: Upload Trigger Artifact
uses: actions/upload-artifact@v3
with:
name: coveralls-linux.tar.gz
path: dist/coveralls-linux.tar.gz
if-no-files-found: error
name: test-binaries-trigger
path: test-binaries-trigger.txt

# - name: Upload coveralls-linux
# uses: actions/upload-artifact@v3
# with:
# name: coveralls-linux
# path: dist/coveralls-linux
#
# - name: Upload coveralls-linux.tar.gz
# uses: actions/upload-artifact@v3
# with:
# name: coveralls-linux.tar.gz
# path: dist/coveralls-linux.tar.gz
#
# - name: Upload coveralls-linux-x86_64
# uses: actions/upload-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@v3
# 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@v3
# with:
# name: coveralls-linux-aarch64
# path: dist/coveralls-linux-aarch64
#
# - name: Upload coveralls-linux-aarch64.tar.gz
# uses: actions/upload-artifact@v3
# with:
# name: coveralls-linux-aarch64.tar.gz
# path: dist/coveralls-linux-aarch64.tar.gz

release:
runs-on: ubuntu-latest
Expand All @@ -104,7 +151,8 @@ jobs:
- name: Fetch tags
run: git fetch --force --tags

- uses: actions/download-artifact@v3
- name: Download binaries
uses: actions/download-artifact@v3
with:
path: artifacts/

Expand All @@ -124,8 +172,12 @@ jobs:
run: >
cd release/;
gh release create ${TAG}
'coveralls-linux#coveralls-linux'
'coveralls-linux.tar.gz#coveralls-linux.tar.gz'
'coveralls-linux-x86_64#coveralls-linux'
'coveralls-linux-x86_64.tar.gz#coveralls-linux.tar.gz'
'coveralls-linux-x86_64#coveralls-linux-x86_64' \
'coveralls-linux-x86_64.tar.gz#coveralls-linux-x86_64.tar.gz' \
'coveralls-linux-aarch64#coveralls-linux-aarch64' \
'coveralls-linux-aarch64.tar.gz#coveralls-linux-aarch64.tar.gz' \
'coveralls-windows.exe#coveralls-windows.exe'
'coveralls-windows.zip#coveralls-windows.zip'
'coveralls-checksums.txt#coveralls-checksums.txt'
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.1
crystal: 1.13.2
- name: Install dependencies
run: shards install
- name: Install coverage.py
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.1
crystal: 1.13.2
- name: Install dependencies
run: shards install
- name: Run linter
Expand All @@ -44,19 +44,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.1
crystal: 1.13.2
- run: make build

- name: Install kcov
run: |
sudo apt-get update
sudo apt-get install kcov

- name: Install coverage.py
run: "pip install --upgrade pip && pip install coverage && pip install pytest"

- name: Generate coverage
run: bin/crkcov --kcov-args --exclude-pattern=/usr/include,/usr/lib,lib/,spec/ --coverage-dir ${{ github.workspace }}/coverage

- name: Report coverage
env:
COVERALLS_REPO_TOKEN: ${{ github.token }}
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/test-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Multi-Arch Linux Binaries After Build

on:
workflow_dispatch: # Trigger manually or on schedule

jobs:
test_binaries:
name: Test Multi-Arch Binaries
runs-on: ubuntu-22.04

strategy:
matrix:
arch: [x86_64, aarch64]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download built artifacts (linux binaries)
uses: actions/download-artifact@v3
with:
name: |
coveralls-linux-x86_64
coveralls-linux-aarch64
path: ./binaries/

- name: Download coverage report
uses: actions/download-artifact@v3
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 }}
Loading
Loading