瀏覽代碼

ci: fix hash in cache key

Philipp Schuster 2 年之前
父節點
當前提交
7151b01ab1
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      .github/workflows/_build-rust.yml

+ 2 - 1
.github/workflows/_build-rust.yml

@@ -52,7 +52,8 @@ jobs:
             ~/.cargo/registry/cache/
             ~/.cargo/registry/cache/
             ~/.cargo/git/db/
             ~/.cargo/git/db/
             target/
             target/
-          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.rust-version }}
+          # We do not have a Cargo.lock here, so I hash Cargo.toml
+          key: ${{ runner.os }}-rust-${{ inputs.rust-version }}-cargo-${{ hashFiles('**/Cargo.toml') }}
           restore-keys: ${{ runner.os }}-cargo-${{ inputs.rust-version }}
           restore-keys: ${{ runner.os }}-cargo-${{ inputs.rust-version }}
       - run: cargo version
       - run: cargo version
       - name: Code Formatting
       - name: Code Formatting