From 9862677fcface46b6ad73a7d4e9da68f8e80671f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E6=AD=A3=E8=B6=85?= Date: Mon, 7 Jul 2025 23:15:40 +0800 Subject: [PATCH] fix: restore Zig and cargo-zigbuild caching in GitHub Actions setup action (#92) * fix: restore Zig and cargo-zigbuild caching in GitHub Actions setup action Use mlugg/setup-zig and taiki-e/cache-cargo-install-action to speed up cross-compilation tool installation and avoid repeated downloads. All comments and code are in English. * fix: use correct taiki-e/install-action for cargo-zigbuild Use taiki-e/install-action@cargo-zigbuild instead of taiki-e/cache-cargo-install-action@v2 to match the original implementation from PR #77. * refactor: remove explicit Zig version to use latest stable --- .github/actions/setup/action.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 32a5c1d0..623ee73e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -86,15 +86,13 @@ runs: targets: ${{ inputs.target }} components: rustfmt, clippy - - name: Install cross-compilation tools + - name: Install Zig if: inputs.install-cross-tools == 'true' - shell: bash - run: | - # Install Zig for cross-compilation - curl -L https://github.com/ziglang/zig/releases/download/0.11.0/zig-linux-x86_64-0.11.0.tar.xz | tar -xJ - sudo mv zig-linux-x86_64-0.11.0/zig /usr/local/bin/ - # Install cargo-zigbuild - cargo install cargo-zigbuild + uses: mlugg/setup-zig@v2 + + - name: Install cargo-zigbuild + if: inputs.install-cross-tools == 'true' + uses: taiki-e/install-action@cargo-zigbuild - name: Setup Rust cache uses: Swatinem/rust-cache@v2