Keep the Expo action's caches off the GitHub cache service (#219)
The mobile OTA job uploaded the EAS CLI to the GitHub cache service because expo-github-action caches by default. Turn both of its caches off and have the Actions budget test reject the Expo action unless they are off. Claude-Session: https://claude.ai/code/session_01Wy1md9QE1ayJbDCwJ4vAQs Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
263e3a31f8
commit
d1dd8ffcd9
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -477,6 +477,9 @@ jobs:
|
||||
eas-version: latest
|
||||
packager: pnpm
|
||||
token: ${{ secrets.EXPO_TOKEN }}
|
||||
# Its default caches go to the GitHub cache service; keep them on the runner.
|
||||
eas-cache: false
|
||||
expo-cache: false
|
||||
- name: Install dependencies
|
||||
if: steps.ota.outputs.publish == 'true' && steps.expo_token.outputs.ready == 'true'
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
@ -13,7 +13,18 @@ const workflows = readdirSync(directory)
|
||||
return {
|
||||
name,
|
||||
text,
|
||||
jobs: (parse(text) as { jobs: Record<string, { "runs-on"?: unknown; uses?: string }> }).jobs,
|
||||
jobs: (
|
||||
parse(text) as {
|
||||
jobs: Record<
|
||||
string,
|
||||
{
|
||||
"runs-on"?: unknown;
|
||||
uses?: string;
|
||||
steps?: Array<{ uses?: string; with?: Record<string, unknown> }>;
|
||||
}
|
||||
>;
|
||||
}
|
||||
).jobs,
|
||||
};
|
||||
});
|
||||
|
||||
@ -34,4 +45,14 @@ describe("GitHub Actions budget", () => {
|
||||
expect(text).not.toContain("type=gha");
|
||||
expect(text).not.toContain("setup-gradle");
|
||||
});
|
||||
|
||||
it.each(workflows)("$name turns off the Expo action's GitHub caches", ({ jobs }) => {
|
||||
for (const job of Object.values(jobs)) {
|
||||
for (const step of job.steps ?? []) {
|
||||
if (!step.uses?.startsWith("expo/expo-github-action")) continue;
|
||||
expect(step.with?.["eas-cache"], step.uses).toBe(false);
|
||||
expect(step.with?.["expo-cache"], step.uses).toBe(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user