Skip to content

Commit

Permalink
ci: group common setup
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroki0525 committed Jan 28, 2024
1 parent f715fea commit 98e30e2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 33 deletions.
16 changes: 16 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Setup
description: "Setup Node.js, pnpm and dependencies"

runs:
using: "composite"
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install --frozen-lockfile
shell: bash
12 changes: 1 addition & 11 deletions .github/workflows/check-bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- uses: ./.github/actions/setup
- name: Build
run: pnpm build
- name: Run BundleMon
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- uses: ./.github/actions/setup
- name: Build
run: pnpm build
- name: Deploy Package
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
- uses: ./.github/actions/setup
- name: Lint Commit Messages
uses: wagoid/commitlint-github-action@v5
- name: Test
Expand Down

0 comments on commit 98e30e2

Please sign in to comment.