From 528abfe50ba36c1e7a647b8fbf5e85007c202e18 Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Thu, 22 Sep 2022 13:47:44 +0900 Subject: [PATCH] added cross crate in workflow to do multi-compile more easy --- .github/workflows/rust.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f576649e..29fc0d74 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,20 +33,22 @@ jobs: args: --all-targets -- -D warnings token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Cross Compile Environment - run: rustup target add x86_64-unknown-linux-musl x86_64-pc-windows-msvc aarch64-apple-darwin x86_64-apple-darwin + run: | + cargo install cross + rustup target add x86_64-unknown-linux-musl x86_64-pc-windows-msvc aarch64-apple-darwin x86_64-apple-darwin - name: Linux gnu Build run: cargo build --verbose - name: x86-64-windows(msvc) Build - run: cargo check --verbose --target x86_64-pc-windows-msvc + run: cross build --verbose --target x86_64-pc-windows-msvc - name: m1 mac Build - run: cargo check --verbose --target aarch64-apple-darwin + run: cross build --verbose --target aarch64-apple-darwin - name: Intel mac Build - run: cargo check --verbose --target x86_64-apple-darwin + run: cross build --verbose --target x86_64-apple-darwin - name: i686-windows(msvc) Build - run: cargo check --verbose --target i686-pc-windows-msvc + run: cross build --verbose --target i686-pc-windows-msvc - name: musl build prepare run: sudo apt install musl-gcc - name: Linux musl Build - run: cargo check --verbose --target x86_64-unknown-linux-musl + run: cross build --verbose --target x86_64-unknown-linux-musl - name: Run tests run: RUST_TEST_THREADS=1 cargo test --verbose \ No newline at end of file