3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-06-19 06:43:41 +00:00

also cache cargo install metadata

This commit is contained in:
Arpad Borsos 2024-12-29 08:47:45 +01:00
parent 720f7e45cc
commit 008623fb83
No known key found for this signature in database
GPG key ID: FC7BCA77824B3298
6 changed files with 56 additions and 49 deletions

View file

@ -8,7 +8,7 @@ const SAVE_TARGETS = new Set(["lib", "proc-macro"]);
export class Workspace {
constructor(public root: string, public target: string) {}
async getPackages(filter: ((p: Meta['packages'][0]) => boolean), ...extraArgs: string[]): Promise<Packages> {
async getPackages(filter: (p: Meta["packages"][0]) => boolean, ...extraArgs: string[]): Promise<Packages> {
let packages: Packages = [];
try {
core.debug(`collecting metadata for "${this.root}"`);
@ -29,11 +29,11 @@ export class Workspace {
}
public async getPackagesOutsideWorkspaceRoot(): Promise<Packages> {
return await this.getPackages(pkg => !pkg.manifest_path.startsWith(this.root));
return await this.getPackages((pkg) => !pkg.manifest_path.startsWith(this.root));
}
public async getWorkspaceMembers(): Promise<Packages> {
return await this.getPackages(_ => true, "--no-deps");
return await this.getPackages((_) => true, "--no-deps");
}
}