Skip to content

Commit ac4fa4b

Browse files
Add musl build action
1 parent 9ef71de commit ac4fa4b

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,41 @@ jobs:
4141
- name: Run Gradle Build
4242
run: ./gradlew build -Ptarget=${{ matrix.target }}
4343

44+
linux-musl:
45+
strategy:
46+
matrix:
47+
include:
48+
- target: x86_64-unknown-linux-musl
49+
deps: |
50+
apk add musl openjdk17
51+
- target: aarch64-unknown-linux-musl
52+
deps: |
53+
apk add musl openjdk17
54+
curl -q https://musl.cc/aarch64-linux-musl-cross.tgz | tar xzf - -C /root/musl
55+
56+
name: Build ${{ matrix.target }}
57+
runs-on: ubuntu-latest
58+
container:
59+
image: alpine:3.18
60+
steps:
61+
- name: Checkout sources
62+
uses: taiki-e/checkout-action@v1
63+
- name: Install Essentials
64+
run: |
65+
apk add curl gcc bash
66+
mkdir -p /root/musl
67+
curl -q https://musl.cc/x86_64-linux-musl-cross.tgz | tar xzf - -C /root/musl
68+
- name: Install Rust toolchain
69+
uses: dtolnay/rust-toolchain@stable
70+
with:
71+
toolchain: stable
72+
target: x86_64-unknown-linux-musl ${{ matrix.target }} # requires native target installed to build proc-macros2
73+
- name: Install linker dependencies
74+
run: ${{ matrix.deps }}
75+
if: ${{ matrix.deps != '' }}
76+
- name: Run Gradle Build
77+
run: ./gradlew build -Ptarget=${{ matrix.target }}
78+
4479
windows:
4580
strategy:
4681
matrix:

0 commit comments

Comments
 (0)