forked from jvm-profiling-tools/perf-map-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions to multi-arch builds
Signed-off-by: Kemal Akkoyun <[email protected]>
- Loading branch information
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- release-* | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
- release-* | ||
merge_group: | ||
branches: | ||
- main | ||
- master | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
QEMU_VERSION: 7.0.0-7 | ||
|
||
jobs: | ||
build-multi-arch: | ||
name: Build for ${{ matrix.arch }} | ||
runs-on: ubuntu-latest | ||
# Run steps on a matrix of 2 arch. | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: | ||
- amd64 | ||
- arm64 | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build the builder image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: Dockerfile.builder | ||
push: false | ||
load: true | ||
platforms: linux/${{ matrix.arch }} | ||
tags: perf-map-agent-builder:latest | ||
|
||
# - name: "Setup QEMU ${{ matrix.arch }}" | ||
# run: | | ||
# # Register QEMU | ||
# docker run --rm --privileged "docker.io/multiarch/qemu-user-static:${QEMU_VERSION}" --reset -p yes | ||
|
||
- name: "Run Builder ${{ matrix.arch }}" | ||
run: | | ||
# Run platform specific based builder image. Run it as a daemon in the background. | ||
# Sleep the container for 1 day so that it keeps running until | ||
# other steps are completed and the steps below can use the same container. | ||
docker run \ | ||
--name=builder \ | ||
--detach \ | ||
--platform 'linux/${{ matrix.arch }}' \ | ||
--volume /home/runner/work:/home/runner/work \ | ||
--workdir "${PWD}" \ | ||
docker.io/library/perf-map-agent-builder:latest \ | ||
bash -c 'uname -m && sleep 1d' | ||
- name: "Build ${{ matrix.arch }}" | ||
shell: docker exec builder bash -e {0} | ||
run: | | ||
cmake . | ||
make | ||
- name: Upload generated artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: perf-map-agent-${{ matrix.arch }} | ||
if-no-files-found: error | ||
path: out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM openjdk:22-slim-bookworm | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
git \ | ||
&& rm -rf /var/lib/apt/lists/* |