From b3712376cfe197ebf3b97b1b5489e897f55cb443 Mon Sep 17 00:00:00 2001 From: saying Date: Mon, 11 Nov 2024 22:57:27 +0800 Subject: [PATCH] ci(cache): replace rust-cache with sccache-cache --- .github/workflows/check.yml | 3 --- .github/workflows/clippy.yml | 7 +++++-- .github/workflows/release.yml | 21 +++++++++++++++------ .github/workflows/test.yml | 22 +++++----------------- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1373d48..28893c7 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -22,9 +22,6 @@ jobs: with: toolchain: stable - - name: Rust Cache - uses: Swatinem/rust-cache@v2 - - name: Install cargo-machete uses: taiki-e/install-action@v2 with: diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 521ac31..d80998c 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -23,8 +23,11 @@ jobs: toolchain: stable components: clippy - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.6 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" - name: Install Dbus if: startsWith(matrix.os, 'ubuntu-') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e8895e..4957b6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,8 +30,11 @@ jobs: run: | echo "rustc=$(rustc --version)" >> "$GITHUB_OUTPUT" - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.6 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" - name: Install cargo-binstall uses: taiki-e/install-action@v2 @@ -72,8 +75,11 @@ jobs: - name: Fetch Repository uses: actions/checkout@v4 - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.6 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" - name: Install Stable Rust Toolchain uses: dtolnay/rust-toolchain@master @@ -161,8 +167,11 @@ jobs: toolchain: stable targets: ${{ matrix.target }} - - name: Rust Cache - uses: Swatinem/rust-cache@v2 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.6 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" - name: Install Dbus if: ${{ !matrix.cross && startsWith(matrix.os, 'ubuntu-') }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f937a49..63dafe2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,23 +26,11 @@ jobs: with: toolchain: stable - - name: Rust Cache - if: startsWith(matrix.os, 'ubuntu-') - uses: Swatinem/rust-cache@v2 - with: - cache-directories: "~/.cache/lcode/" - - - name: Rust Cache - if: startsWith(matrix.os, 'windows-') - uses: Swatinem/rust-cache@v2 - with: - cache-directories: "~/AppData/Local/lcode/" - - - name: Rust Cache - if: startsWith(matrix.os, 'macos-') - uses: Swatinem/rust-cache@v2 - with: - cache-directories: "~/Library/Caches/lcode/" + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.6 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" - name: Install Dependencies if: startsWith(matrix.os, 'ubuntu-')