浏览代码

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/git/db/
             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 }}
       - run: cargo version
       - name: Code Formatting