Skip to content

Commit b8fc0b1

Browse files
Add validation workflow for typechecking, linting, and formatting (#271)
* Implement validation workflow * delete branch protection setup document
1 parent 9235356 commit b8fc0b1

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

.github/workflows/validate.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Validate
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
# Concurrency configuration to cancel previous runs on new commits
8+
concurrency:
9+
group: validate-${{ github.event.pull_request.number }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
validate:
14+
name: ${{ matrix.check }}
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
check:
19+
- TypeScript Check
20+
- Lint Check
21+
- Format Check
22+
include:
23+
- check: TypeScript Check
24+
command: typecheck
25+
- check: Lint Check
26+
command: lint
27+
- check: Format Check
28+
command: format:check
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-node@v4
32+
with:
33+
node-version: '22'
34+
cache: 'npm'
35+
cache-dependency-path: 'package-lock.json'
36+
- name: Install dependencies
37+
run: npm ci
38+
- name: Run ${{ matrix.check }}
39+
run: npm run ${{ matrix.command }}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"clear": "npm run prebuild -- clean && docusaurus clear",
1515
"serve": "docusaurus serve",
1616
"typecheck": "tsc",
17-
"format": "prettier --write ."
17+
"format": "prettier .",
18+
"format:check": "npm run format -- --check",
19+
"format:write": "npm run format -- --write",
20+
"lint": "echo 0;"
1821
},
1922
"dependencies": {
2023
"@docusaurus/core": "^3.8.1",
@@ -50,7 +53,7 @@
5053
]
5154
},
5255
"engines": {
53-
"node": ">=22.0"
56+
"node": ">=22"
5457
},
5558
"prettier": "@harperdb/code-guidelines/prettier"
5659
}

0 commit comments

Comments
 (0)