Skip to content

Commit 8fb8ac4

Browse files
committed
rebase
1 parent ad8c212 commit 8fb8ac4

File tree

5 files changed

+117
-42
lines changed

5 files changed

+117
-42
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
actions: read
12+
13+
jobs:
14+
quality:
15+
name: Lint & Format
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Harden Runner
20+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
21+
with:
22+
egress-policy: audit
23+
24+
- name: Checkout code
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
29+
with:
30+
cache: 'npm'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Run linting
36+
run: npm run lint
37+
38+
- name: Check formatting
39+
run: npm run format:check
40+
41+
test:
42+
name: Test & Coverage
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Harden Runner
47+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
48+
with:
49+
egress-policy: audit
50+
51+
- name: Checkout code
52+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
54+
- name: Setup Node.js
55+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
56+
with:
57+
cache: 'npm'
58+
59+
- name: Install dependencies
60+
run: npm ci
61+
62+
- name: Run tests with coverage
63+
run: npm run test:ci
64+
65+
- name: Upload coverage to Codecov
66+
if: always()
67+
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
68+
with:
69+
files: ./lcov.info
70+
71+
- name: Upload test results to Codecov
72+
if: always()
73+
uses: codecov/test-results-action@f2dba722c67b86c6caa034178c6e4d35335f6706 # v1.1.0
74+
with:
75+
files: ./junit.xml

.github/workflows/pr.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ npm-debug.log
44

55
# Default Output Directory
66
out
7+
8+
# Tests
9+
lcov.info
10+
junit.xml

package-lock.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
"lint:fix": "eslint --fix . --no-warn-ignored",
1010
"format": "prettier .",
1111
"format:write": "prettier --write .",
12+
"format:check": "prettier --check .",
1213
"test": "node --test",
1314
"test:coverage": "node --experimental-test-coverage --test",
15+
"test:ci": "node --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info --test-reporter=junit --test-reporter-destination=junit.xml --test-reporter=@reporters/github --test-reporter-destination=stdout --test-reporter=spec --test-reporter-destination=stdout --test",
1416
"test:update-snapshots": "node --test --test-update-snapshots",
1517
"test:watch": "node --test --watch",
1618
"prepare": "husky",
@@ -23,6 +25,7 @@
2325
},
2426
"devDependencies": {
2527
"@eslint/js": "^9.27.0",
28+
"@reporters/github": "^1.7.2",
2629
"@types/mdast": "^4.0.4",
2730
"@types/node": "^22.15.3",
2831
"eslint": "^9.27.0",

0 commit comments

Comments
 (0)