Skip to content

Commit 65f1748

Browse files
committed
ci: 重命名 setup-nvm 动作为 setup-npm 并升级配置
- 将 .github/actions/setup-nvm/action.yml 重命名为 .github/actions/setup-npm/action.yml - 在 setup-npm 动作中升级 actions/setup-node@v3 为 actions/setup-node@v4 - 修改 code-review、test、release-please 工作流,使用新的 setup-npm 动作 - 在 setup-npm 动作中增加 npm ci 步骤
1 parent 8aa7796 commit 65f1748

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: setup nvm
1+
name: setup
22
description: 依照 nvmrc 创建 node 环境
33

44
runs:
@@ -8,8 +8,10 @@ runs:
88
shell: bash
99
- run: timedatectl
1010
shell: bash
11-
- uses: actions/setup-node@v3
11+
- uses: actions/setup-node@v4
1212
with:
1313
node-version-file: .nvmrc
1414
cache: npm
15-
cache-dependency-path: '**/package-lock.json'
15+
cache-dependency-path: package-lock.json
16+
- run: npm ci
17+
shell: bash

.github/workflows/code-review.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19-
- uses: ./.github/actions/setup-nvm
20-
- run: npm ci
19+
- uses: ./.github/actions/setup-npm
2120
- run: npm run lint
2221

2322
test:
2423
runs-on: ubuntu-latest
2524
steps:
2625
- uses: actions/checkout@v4
27-
- uses: ./.github/actions/setup-nvm
28-
- run: npm ci
26+
- uses: ./.github/actions/setup-npm
2927
- run: npm run test:coverage
3028
- uses: codacy/codacy-coverage-reporter-action@v1
3129
if: github.actor != 'dependabot[bot]'

.github/workflows/release-please.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ jobs:
3030
id-token: write
3131
steps:
3232
- uses: actions/checkout@v4
33-
- uses: ./.github/actions/setup-nvm
34-
- run: npm ci
33+
- uses: ./.github/actions/setup-npm
3534
- run: npm run build
3635
- uses: FrontEndDev-org/publish-node-package-action@v2
3736
with:
@@ -47,8 +46,7 @@ jobs:
4746
packages: write
4847
steps:
4948
- uses: actions/checkout@v4
50-
- uses: ./.github/actions/setup-nvm
51-
- run: npm ci
49+
- uses: ./.github/actions/setup-npm
5250
- run: npm run build
5351
- uses: FrontEndDev-org/publish-node-package-action@v2
5452
with:

0 commit comments

Comments
 (0)