Skip to content

Commit

Permalink
fix: 优化 actions 12
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Mar 17, 2023
1 parent de56892 commit a684fae
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
19 changes: 0 additions & 19 deletions .github/common-workflows/node-env.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/_node-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: node env
description: 根据 .nvmrc 配置 node 环境

on:
workflow_call:

jobs:
node-env:
runs:
runs-on: ubuntu-latest
steps:
- run: sudo timedatectl set-timezone Asia/Shanghai
- run: timedatectl
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: '**/package-lock.json'
4 changes: 2 additions & 2 deletions .github/workflows/code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: ./.github/common-workflows/node-env.yml
- uses: ./.github/workflows/_node-env.yml
- run: npm ci
- run: npm run lint
test:
runs-on: ubuntu-latest
steps:
- uses: ./.github/common-workflows/node-env.yml
- uses: ./.github/workflows/_node-env.yml
- run: npm ci
- run: npm run test
6 changes: 3 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: ./.github/common-workflows/node-env.yml
- uses: ./.github/workflows/_node-env.yml
- uses: google-github-actions/release-please-action@v3
id: release
with:
Expand All @@ -27,7 +27,7 @@ jobs:
needs: release
if: needs.release.outputs.release_created
steps:
- uses: ./.github/common-workflows/node-env.yml
- uses: ./.github/workflows/_node-env.yml
- run: npm ci
- run: npm run test
- uses: codacy/codacy-coverage-reporter-action@v1
Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: ./.github/common-workflows/node-env.yml
- uses: ./.github/workflows/_node-env.yml
- run: npm ci
- run: npm run build
- run: npm publish --registry=https://registry.npmjs.org
Expand Down

0 comments on commit a684fae

Please sign in to comment.