File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments