Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

Commit 3a88400

Browse files
authored
ci: setup ci (#1)
1 parent 8293601 commit 3a88400

8 files changed

Lines changed: 138 additions & 3 deletions

File tree

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.eslintrc.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"plugin:yaml/recommended",
1111
"prettier"
1212
],
13+
"settings": {
14+
"react": {
15+
"version": "detect"
16+
}
17+
},
1318
"env": {
1419
"browser": true,
1520
"node": true,

.github/workflows/e2e.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
workflow_call:
6+
7+
jobs:
8+
main:
9+
timeout-minutes: 30
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest, windows-latest]
13+
runs-on: ${{ matrix.os }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: lts/*
19+
- run: npm i
20+
- run: npm run build-all
21+
- run: npm run e2e

.github/workflows/lint-code.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
workflow_call:
6+
7+
jobs:
8+
main:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: lts/*
15+
- run: npm i
16+
- run: npm run lint-all
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
pull_request:
3+
types:
4+
- opened
5+
- synchronize
6+
- reopened
7+
- edited
8+
branches:
9+
- main
10+
11+
jobs:
12+
main:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: lts/*
19+
- run: npm i
20+
- run: echo '${{ github.event.pull_request.title }}' | npx -y @commitlint/cli@17

.github/workflows/unittest.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
workflow_call:
6+
7+
jobs:
8+
main:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: lts/*
15+
- run: npm i
16+
- run: npm run unittest -- --coverage
17+
- uses: codecov/codecov-action@v3
18+
with:
19+
token: ${{ secrets.CODECOV_TOKEN }}
20+
flags: unittest
21+
directory: ./coverage
22+
verbose: true
23+
fail_ci_if_error: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- latest
6+
7+
jobs:
8+
unittest:
9+
uses: ./.github/workflows/unittest.yml
10+
e2e:
11+
uses: ./.github/workflows/e2e.yml
12+
lint-code:
13+
uses: ./.github/workflows/lint-code.yml
14+
release:
15+
needs:
16+
- unittest
17+
- e2e
18+
- lint-code
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# For what each permission scope represents, refer to:
22+
# https://docs.github.com/en/rest/overview/permissions-required-for-github-apps
23+
contents: write
24+
issues: write
25+
pull-requests: write
26+
steps:
27+
- uses: actions/checkout@v3
28+
with:
29+
fetch-depth: 0
30+
- uses: actions/setup-node@v3
31+
with:
32+
node-version: lts/*
33+
- run: npm i
34+
- run: npm run build-all
35+
- env:
36+
NPM_TOKEN: ${{secrets.SL_NPM_TOKEN}}
37+
GITHUB_TOKEN: ${{secrets.SL_GITHUB_TOKEN}}
38+
run: npx -y semantic-release@21

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,22 @@
5858
"typetest": "tsd -f \"src/**/*.test-d.ts?(x)\"",
5959
"e2e": "cross-env TYPE=e2e jest",
6060
"serve": "npx -y serve@14 -p 3030",
61-
"verdaccio": "npx -y verdaccio@5 -c verdaccio/config.yml"
61+
"verdaccio": "npx -y verdaccio@5 -c verdaccio/config.yml",
62+
"lint-all": "run-p \"lint:**\"",
63+
"lint:tsc": "tsc",
64+
"lint:eslint": "eslint \"**/*\"",
65+
"lint:prettier": "prettier --check \"**/*\"",
66+
"fix-all": "run-s \"fix:**\"",
67+
"fix:eslint": "eslint --fix \"**/*\"",
68+
"fix:prettier": "prettier --write \"**/*\"",
69+
"git-clean": "git clean -d -f -x -e node_modules -e package-lock.json"
6270
},
6371
"peerDependencies": {
6472
"react": "^18",
6573
"statofu": "^1"
6674
},
6775
"devDependencies": {
76+
"@commitlint/config-conventional": "^17.6.6",
6877
"@rollup/plugin-commonjs": "^25.0.1",
6978
"@rollup/plugin-node-resolve": "^15.1.0",
7079
"@rollup/plugin-terser": "^0.4.3",
@@ -80,8 +89,8 @@
8089
"@types/node": ">=16",
8190
"@types/react": "^18.2.14",
8291
"@types/react-dom": "^18.2.6",
83-
"@typescript-eslint/eslint-plugin": "^5.59.11",
84-
"@typescript-eslint/parser": "^5.59.11",
92+
"@typescript-eslint/eslint-plugin": "^5.60.0",
93+
"@typescript-eslint/parser": "^5.60.0",
8594
"cross-env": "^7.0.3",
8695
"cross-spawn": "^7.0.3",
8796
"eslint": "^8.42.0",

0 commit comments

Comments
 (0)