Skip to content

Commit

Permalink
ci: add pnpm action
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Sep 11, 2024
1 parent 77c0c79 commit 6114c84
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 31 deletions.
15 changes: 15 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pnpm

runs:
using: composite
steps:
- uses: pnpm/action-setup@v4.0.0

- uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'
cache: pnpm

- run: pnpm install --frozen-lockfile
shell: bash
9 changes: 1 addition & 8 deletions .github/workflows/bump_oxlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- run: corepack enable

- uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm
- uses: ./.github/actions/pnpm

- name: Bump oxlint rules
run: |
pnpm install
pnpm update oxlint
pnpm install
pnpm run clone
pnpm run generate # Generate rules from latest oxlint
pnpm run test -u # Update test snapshots
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,7 @@ jobs:
with:
fetch-depth: 0

- name: Install pnpm
run: corepack enable

- name: Set node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'
cache: pnpm
- uses: ./.github/actions/pnpm

- name: Extract version from commit message
run: |
Expand All @@ -41,9 +33,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install Dependencies
run: pnpm i

- name: Publish to NPM
run: npm publish --tag latest --provenance --access public
env:
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2

- name: Set node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: pnpm

- name: Install Dependencies
run: pnpm i
- uses: ./.github/actions/pnpm

- name: Run Linters
run: pnpm run lint
Expand Down

0 comments on commit 6114c84

Please sign in to comment.