-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathblockCodecov.ts
48 lines (46 loc) · 925 Bytes
/
blockCodecov.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { z } from "zod";
import { base } from "../base.js";
import { blockGitHubApps } from "./blockGitHubApps.js";
import { blockVitest } from "./blockVitest.js";
import { CommandPhase } from "./phases.js";
export const blockCodecov = base.createBlock({
about: {
name: "Codecov",
},
addons: { env: z.record(z.string(), z.string()).optional() },
migrate() {
return {
scripts: [
{
silent: true,
commands: ["rm .github/codecov.yml codecov.yml"],
phase: CommandPhase.Migrations,
},
],
};
},
produce({ addons }) {
const { env } = addons;
return {
addons: [
blockGitHubApps({
apps: [
{
name: "Codecov",
url: "https://github.com/apps/codecov",
},
],
}),
blockVitest({
actionSteps: [
{
...(env && { env }),
if: "always()",
uses: "codecov/codecov-action@v3",
},
],
}),
],
};
},
});