From da42bbe56dfdd9085c9baf259c1894f679956942 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Mon, 15 Mar 2021 12:03:26 +0300 Subject: [PATCH] Additionally key on Rust toolchain file(s) if present --- README.md | 3 ++- src/common.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5591719..bbe2ec1 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,8 @@ This cache is automatically keyed by: - the github `job`, - the rustc release / host / hash, and -- a hash of the `Cargo.lock` / `Cargo.toml` files. +- a hash of the `Cargo.lock` / `Cargo.toml` files (if present). +- a hash of the `rust-toolchain` / `rust-toolchain.toml` files (if present). An additional input `key` can be provided if the builtin keys are not sufficient. diff --git a/src/common.ts b/src/common.ts index edce69d..4d8c2aa 100644 --- a/src/common.ts +++ b/src/common.ts @@ -136,7 +136,7 @@ export async function getCmdOutput( } async function getLockfileHash(): Promise { - const globber = await glob.create("**/Cargo.toml\n**/Cargo.lock", { followSymbolicLinks: false }); + const globber = await glob.create("**/Cargo.toml\n**/Cargo.lock\nrust-toolchain\nrust-toolchain.toml", { followSymbolicLinks: false }); const files = await globber.glob(); files.sort((a, b) => a.localeCompare(b));