Skip to content

Commit f4aee3e

Browse files
committed
chore: add CI, release, and commit validation workflows
1 parent a2116ef commit f4aee3e

File tree

6 files changed

+8779
-1490
lines changed

6 files changed

+8779
-1490
lines changed

.commitlintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {
4+
"type-enum": [
5+
2,
6+
"always",
7+
[
8+
"feat",
9+
"fix",
10+
"docs",
11+
"style",
12+
"refactor",
13+
"perf",
14+
"test",
15+
"build",
16+
"ci",
17+
"chore",
18+
"revert"
19+
]
20+
],
21+
"subject-case": [2, "never", ["start-case", "pascal-case", "upper-case"]],
22+
"subject-empty": [2, "never"],
23+
"subject-full-stop": [2, "never", "."],
24+
"type-case": [2, "always", "lower-case"],
25+
"type-empty": [2, "never"]
26+
}
27+
}

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test-and-build:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [22.x]
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run linting
30+
run: npm run lint
31+
32+
- name: Check code formatting
33+
run: npm run format:check
34+
35+
- name: Run tests
36+
run: npm run test:ci
37+
38+
- name: Build project
39+
run: npm run build
40+
41+
- name: Upload test results
42+
if: always()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: test-results
46+
path: test-results.json

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
23+
token: ${{ secrets.RELEASE_TOKEN }}
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: 22.x
29+
cache: 'npm'
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Run tests
35+
run: npm run test:ci
36+
37+
- name: Build project
38+
run: npm run build
39+
40+
- name: Release
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
43+
run: npx semantic-release
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Validate Conventional Commits
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
jobs:
8+
validate-commits:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Validate commit messages
18+
uses: wagoid/commitlint-github-action@v6
19+
with:
20+
configFile: .commitlintrc.json

0 commit comments

Comments
 (0)