Skip to content

Commit dd4ba8c

Browse files
authored
chore: Use Codecov (#53)
* chore: Install codecov/codecov-action * chore: Use codecov/codecov-action * chore: Add codecov badge to readme
1 parent a1c7235 commit dd4ba8c

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

.github/workflows/actions-lock.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"actions": {
33
"actions/[email protected]": "5a3ec84eff668545956fd18022155c47e93e2684",
44
"actions/[email protected]": "11bd71901bbe5b1630ceea73d27597364c9af683",
5+
"codecov/[email protected]": "0565863a31f2c772f9f0395002a31e3f06189574",
56
"googleapis/[email protected]": "a02a34c4d625f9be7cb89156071d8567266a2445",
67
"jdx/[email protected]": "5083fe46898c414b2475087cc79da59e7da859e8",
78
"koki-develop/github-actions-lint/[email protected]": "cd40a2834e54895146e4a73ae17dcc37944ffb0f",

.github/workflows/actions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"actions/cache": "v4.2.3",
33
"actions/checkout": "v4.2.2",
4+
"codecov/codecov-action": "v5.4.0",
45
"googleapis/release-please-action": "v4.2.0",
56
"jdx/mise-action": "v2.1.11",
67
"koki-develop/github-actions-lint/actionlint": "v1.1.0",

.github/workflows/ci.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Workflow } from "ghats";
1+
import { action, Workflow } from "ghats";
22
import { setupJob } from "./_helpers";
33

44
const workflow = new Workflow("CI", {
@@ -14,7 +14,18 @@ workflow.addJob(
1414
permissions: { contents: "read" },
1515
timeoutMinutes: 5,
1616
withBun: true,
17-
}).run("bun test"),
17+
})
18+
.run("bun test --coverage --coverage-reporter=lcov")
19+
.uses(
20+
action("codecov/codecov-action", {
21+
with: {
22+
token: "${{ secrets.CODECOV_TOKEN }}",
23+
files: "coverage/lcov.info",
24+
disable_search: "true",
25+
verbose: "true",
26+
},
27+
}),
28+
),
1829
);
1930

2031
workflow.addJob(

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# DO NOT EDIT THIS FILE
22
# This file is automatically generated by ghats (https://www.npmjs.com/package/ghats)
33
# Edit the workflow in .github/workflows/ci.ts instead, and run `ghats build` to update this file.
4-
{"name":"CI","on":{"pull_request":{"branches":["main"]},"push":{"branches":["main"]}},"permissions":{},"jobs":{"test":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"bun test"}]},"build-workflow":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"\ncat <<EOF > ./.github/workflows/example.ts\nimport { Workflow, Job } from \"ghats\";\n\nconst workflow = new Workflow(\"Hello\", {\n on: \"push\",\n});\n\nworkflow.addJob(\n new Job(\"hello\", {\n runsOn: \"ubuntu-latest\",\n })\n .uses(\"actions/checkout@v4\")\n .run(\"echo 'Hello, world!'\"),\n);\n\nexport default workflow;\nEOF\n"},{"run":"bun run ./lib/cli/index.ts build ./.github/workflows/example.ts"},{"run":"cat ./.github/workflows/example.yml"}]}}}
4+
{"name":"CI","on":{"pull_request":{"branches":["main"]},"push":{"branches":["main"]}},"permissions":{},"jobs":{"test":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"bun test --coverage --coverage-reporter=lcov"},{"with":{"token":"${{ secrets.CODECOV_TOKEN }}","files":"coverage/lcov.info","disable_search":"true","verbose":"true"},"uses":"codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574"}]},"build-workflow":{"runs-on":"ubuntu-latest","permissions":{"contents":"read"},"timeout-minutes":5,"steps":[{"with":{"persist-credentials":"false"},"uses":"actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683"},{"uses":"jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8"},{"with":{"path":"~/.bun/install/cache","key":"${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}","restore-keys":"${{ runner.os }}-bun-"},"uses":"actions/cache@5a3ec84eff668545956fd18022155c47e93e2684"},{"run":"bun install --frozen-lockfile"},{"run":"\ncat <<EOF > ./.github/workflows/example.ts\nimport { Workflow, Job } from \"ghats\";\n\nconst workflow = new Workflow(\"Hello\", {\n on: \"push\",\n});\n\nworkflow.addJob(\n new Job(\"hello\", {\n runsOn: \"ubuntu-latest\",\n })\n .uses(\"actions/checkout@v4\")\n .run(\"echo 'Hello, world!'\"),\n);\n\nexport default workflow;\nEOF\n"},{"run":"bun run ./lib/cli/index.ts build ./.github/workflows/example.ts"},{"run":"cat ./.github/workflows/example.yml"}]}}}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# GitHub Actions with TypeScript
22

33
[![NPM Version](https://img.shields.io/npm/v/ghats)](https://www.npmjs.com/package/ghats)
4+
[![codecov](https://codecov.io/gh/koki-develop/ghats/graph/badge.svg?token=M38AAFPXC1)](https://codecov.io/gh/koki-develop/ghats)
45
[![GitHub License](https://img.shields.io/github/license/koki-develop/ghats)](./LICENSE)
56

67
```ts

0 commit comments

Comments
 (0)