mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-05-18 15:14:45 +00:00
Support a list of cache-dependency-glob (#41)
Closes: #40 Because of build conflics (forgot to run `npm i` after pulling) I deleted the `dist`folder to start fresh. Turns out that it still contained the source maps from the very first commit. I removed the argument to generate those a long time ago
This commit is contained in:
parent
606b0d67da
commit
d9a2b6b6fa
18 changed files with 66 additions and 71358 deletions
14
src/cache/restore-cache.ts
vendored
14
src/cache/restore-cache.ts
vendored
|
@ -1,7 +1,6 @@
|
|||
import * as cache from "@actions/cache";
|
||||
import * as glob from "@actions/glob";
|
||||
import * as core from "@actions/core";
|
||||
import path from "path";
|
||||
import {
|
||||
cacheDependencyGlob,
|
||||
cacheLocalPath,
|
||||
|
@ -37,11 +36,18 @@ export async function restoreCache(version: string): Promise<void> {
|
|||
async function computeKeys(version: string): Promise<string> {
|
||||
let cacheDependencyPathHash = "-";
|
||||
if (cacheDependencyGlob !== "") {
|
||||
const fullCacheDependencyGlob = `${process.env["GITHUB_WORKSPACE"]}${path.sep}${cacheDependencyGlob}`;
|
||||
cacheDependencyPathHash += await glob.hashFiles(fullCacheDependencyGlob);
|
||||
core.info(
|
||||
`Searching files using cache dependency glob: ${cacheDependencyGlob.split("\n").join(",")}`,
|
||||
);
|
||||
cacheDependencyPathHash += await glob.hashFiles(
|
||||
cacheDependencyGlob,
|
||||
undefined,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
if (cacheDependencyPathHash === "-") {
|
||||
throw new Error(
|
||||
`No file in ${process.cwd()} matched to [${cacheDependencyGlob}], make sure you have checked out the target repository`,
|
||||
`No file in ${process.cwd()} matched to [${cacheDependencyGlob.split("\n").join(",")}], make sure you have checked out the target repository`,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue