summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.generate.ts
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-01-12 12:07:37 -0500
committerGitHub <noreply@github.com>2023-01-12 12:07:37 -0500
commit3713a10b644f3a99207201ba02956f4b3bdc9d1a (patch)
treea9052084ac3a643bb78ebde85ef593dfefa59341 /.github/workflows/ci.generate.ts
parent120bc5450f98fe95bc3ae2a06b1c345bbb1e18c1 (diff)
chore(ci): use mtime cache for fastci (#17373)
Diffstat (limited to '.github/workflows/ci.generate.ts')
-rw-r--r--.github/workflows/ci.generate.ts16
1 files changed, 10 insertions, 6 deletions
diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index 7fd40d839..5f2946e36 100644
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -150,7 +150,7 @@ function cancelEarlyIfDraftPr(
].join("\n"),
},
...nextSteps.map((step) =>
- skipForCondition(step, "steps.exit_early.outputs.EXIT_EARLY != 'true'")
+ withCondition(step, "steps.exit_early.outputs.EXIT_EARLY != 'true'")
),
];
}
@@ -162,14 +162,14 @@ function skipJobsIfPrAndMarkedSkip(
// so just apply this condition to all the steps.
// https://stackoverflow.com/questions/65384420/how-to-make-a-github-action-matrix-element-conditional
return steps.map((s) =>
- skipForCondition(
+ withCondition(
s,
"!(github.event_name == 'pull_request' && matrix.skip_pr)",
)
);
}
-function skipForCondition(
+function withCondition(
step: Record<string, unknown>,
condition: string,
): Record<string, unknown> {
@@ -327,7 +327,9 @@ const ci = {
if: "matrix.job == 'lint' || matrix.job == 'test'",
...installDenoStep,
},
- ...installPythonSteps,
+ ...installPythonSteps.map((s) =>
+ withCondition(s, "matrix.job != 'lint'")
+ ),
{
// only necessary for benchmarks
if: "matrix.job == 'bench'",
@@ -435,9 +437,11 @@ const ci = {
},
{
name: "Apply and update mtime cache",
- if: "matrix.profile == 'release'",
+ if: "!startsWith(github.ref, 'refs/tags/')",
uses: "./.github/mtime_cache",
- with: { "cache-path": "./target" },
+ with: {
+ "cache-path": "./target",
+ },
},
{
// Shallow the cloning the crates.io index makes CI faster because it