Skip to content

Commit 40a8f89

Browse files
committed
chore(build) test musl build
1 parent 95480e4 commit 40a8f89

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/test-build.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ jobs:
6363
- name: Install Rust
6464
uses: dtolnay/rust-toolchain@stable
6565

66+
- name: Add musl target
67+
run: rustup target add x86_64-unknown-linux-musl
68+
69+
- name: Install musl toolchain
70+
run: |
71+
sudo apt-get update
72+
sudo apt-get install -y musl-tools
73+
6674
- name: Cache Rust dependencies
6775
uses: actions/cache@v4
6876
with:
@@ -76,18 +84,17 @@ jobs:
7684
restore-keys: |
7785
${{ runner.os }}-cargo-
7886
79-
- name: Build Linux x86_64 binary (test)
87+
- name: Build Linux x86_64 musl binary (test)
8088
working-directory: ./anycode-backend
81-
run: cargo build --release
89+
run: cargo build --release --target x86_64-unknown-linux-musl
8290

8391
- name: Check binary size
8492
working-directory: ./anycode-backend
8593
run: |
86-
ls -lh target/release/anycode
87-
file target/release/anycode
94+
ls -lh target/x86_64-unknown-linux-musl/release/anycode
95+
file target/x86_64-unknown-linux-musl/release/anycode
8896
8997
- name: Test binary help
9098
working-directory: ./anycode-backend
9199
run: |
92-
./target/release/anycode --help
93-
100+
./target/x86_64-unknown-linux-musl/release/anycode --help

0 commit comments

Comments
 (0)