Skip to content

Commit 6785479

Browse files
authored
chore: update GitHub Actions and dependencies (#26)
1 parent 31ee033 commit 6785479

File tree

7 files changed

+3019
-2555
lines changed

7 files changed

+3019
-2555
lines changed

.github/workflows/check-pr.yaml

+13-27
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,37 @@ on:
66
jobs:
77
check-pr:
88
runs-on: ubuntu-latest
9-
109
steps:
1110
- name: Checkout repository
12-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1312
with:
1413
fetch-depth: 0
1514

1615
- name: Set up Node
17-
uses: actions/setup-node@v3
16+
uses: actions/setup-node@v4
1817
with:
1918
node-version: lts/*
2019
cache: yarn
2120

21+
- name: Check commits messages
22+
uses: wagoid/commitlint-github-action@v6
23+
24+
- name: Check PR name
25+
uses: amannn/action-semantic-pull-request@v5
26+
2227
- name: Install dependencies
2328
run: yarn install --frozen-lockfile
2429

25-
- name: Check types
26-
run: yarn build
30+
- name: Check formatting
31+
run: yarn format
2732

2833
- name: Check linting
2934
run: yarn lint
3035

31-
- name: Check commits messages
32-
uses: wagoid/commitlint-github-action@v4
36+
- name: Run build
37+
run: yarn build
3338

3439
tests:
35-
runs-on: ubuntu-latest
36-
3740
needs: check-pr
41+
uses: ./.github/workflows/tests.yml
3842

39-
strategy:
40-
matrix:
41-
node-version: [14.x, 16.x, 18.x]
42-
43-
steps:
44-
- uses: actions/checkout@v3
45-
46-
- name: Use Node.js ${{ matrix.node-version }}
47-
uses: actions/setup-node@v3
48-
with:
49-
node-version: ${{ matrix.node-version }}
50-
cache: yarn
51-
52-
- name: Install dependencies
53-
run: yarn install --frozen-lockfile
54-
55-
- name: Run Tests
56-
run: yarn test

.github/workflows/release.yaml

+11-5
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,35 @@ on:
77
- next
88

99
jobs:
10+
tests:
11+
uses: ./.github/workflows/tests.yml
1012
release:
13+
needs: test
1114
runs-on: ubuntu-latest
1215

1316
steps:
1417
- name: Checkout repository
15-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1619
with:
1720
persist-credentials: false
1821
fetch-depth: 0
1922

2023
- name: Set up Node
21-
uses: actions/setup-node@v3
24+
uses: actions/setup-node@v4
2225
with:
2326
node-version: lts/*
2427
cache: yarn
2528

2629
- name: Install dependencies
2730
run: yarn install --frozen-lockfile
2831

29-
- name: Run Tests
30-
run: yarn test
32+
- name: Check formatting
33+
run: yarn format
3134

32-
- name: Run Build
35+
- name: Check linting
36+
run: yarn lint
37+
38+
- name: Run build
3339
run: yarn build
3440

3541
- name: Run Semantic-Release

.github/workflows/tests.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
10+
needs: check-pr
11+
12+
strategy:
13+
matrix:
14+
node-version: [14.x, 16.x, 18.x, 20.x, 22.x]
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: yarn
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
29+
- name: Run Tests
30+
run: yarn test

.husky/commit-msg

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no -- commitlint --edit "${1}"

.husky/pre-commit

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx lint-staged

package.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,40 @@
3333
"build:main": "tsc -p tsconfig.json",
3434
"build:module": "tsc -p tsconfig.module.json",
3535
"lint": "eslint --ignore-path .gitignore \"src/**/*.ts\"",
36-
"format": "prettier --ignore-path .gitignore \"src/**/*.ts\" --write",
36+
"format": "prettier --check --ignore-path .gitignore \"src/**/*.ts\"",
3737
"test": "vitest",
3838
"coverage": "vitest --coverage",
3939
"reset-hard": "git clean -dfx && git reset --hard && yarn install",
4040
"prepare-release": "run-s reset-hard test",
41-
"prepare": "husky install",
41+
"prepare": "husky",
4242
"release": "semantic-release"
4343
},
4444
"dependencies": {
45-
"axios": "^1.1.3",
45+
"axios": "^1.7.4",
4646
"fast-text-encoding": "^1.0.6",
47-
"qrcode": "^1.5.1"
47+
"qrcode": "^1.5.4"
4848
},
4949
"devDependencies": {
50-
"@commitlint/cli": "^17.2.0",
51-
"@commitlint/config-conventional": "^17.2.0",
52-
"@semantic-release/changelog": "^6.0.1",
50+
"@commitlint/cli": "^19.4.0",
51+
"@commitlint/config-conventional": "^19.2.2",
52+
"@semantic-release/changelog": "^6.0.3",
5353
"@semantic-release/git": "^10.0.1",
5454
"@types/node": "^18.11.9",
55-
"@types/qrcode": "^1.5.0",
55+
"@types/qrcode": "^1.5.5",
5656
"@typescript-eslint/eslint-plugin": "^5.43.0",
5757
"@typescript-eslint/parser": "^5.43.0",
58-
"@vitest/coverage-c8": "^0.25.2",
59-
"eslint": "^8.28.0",
58+
"@vitest/coverage-v8": "^2.0.5",
59+
"eslint": "8",
6060
"eslint-config-prettier": "^8.5.0",
6161
"eslint-plugin-prettier": "^4.2.1",
62-
"husky": "^8.0.2",
63-
"lint-staged": "^13.0.3",
62+
"husky": "^9.1.4",
63+
"lint-staged": "^15.2.9",
6464
"npm-run-all": "^4.1.5",
65-
"prettier": "^2.7.1",
66-
"semantic-release": "^19.0.5",
67-
"ts-node": "^10.9.1",
68-
"typescript": "^4.9.3",
69-
"vitest": "^0.25.2"
65+
"prettier": "2",
66+
"semantic-release": "^24.1.0",
67+
"ts-node": "^10.9.2",
68+
"typescript": "^5.5.4",
69+
"vitest": "^2.0.5"
7070
},
7171
"files": [
7272
"dist/main",
@@ -83,4 +83,4 @@
8383
"yarn format"
8484
]
8585
}
86-
}
86+
}

0 commit comments

Comments
 (0)