Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(.github): add 'setup' composite action for 'pnpm' and 'node' setup #2932

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Setup
description: Setup pnpm and node

runs:
using: composite
steps:
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
Copy link
Member

@dai-shi dai-shi Jan 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this line L12?

6 changes: 1 addition & 5 deletions .github/workflows/compressed-size-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: ./.github/actions/setup
- uses: preactjs/compressed-size-action@v2
with:
pattern: './dist/**/*.{js,mjs}'
6 changes: 1 addition & 5 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: ./.github/actions/setup
- run: pnpm install
- run: pnpm build
- run: pnpm dlx pkg-pr-new publish './dist' --compact --template './examples/*'
6 changes: 1 addition & 5 deletions .github/workflows/lint-and-type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: ./.github/actions/setup
- run: pnpm install
- run: pnpm test:format
- run: pnpm test:types
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'
- uses: ./.github/actions/setup
- run: pnpm install
- run: pnpm test
- run: pnpm build
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test-multiple-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
env: [development] # [development, production]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: ./.github/actions/setup
- run: pnpm install
- run: pnpm build
- name: Patch for DEV-ONLY
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/test-multiple-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: ./.github/actions/setup
- run: pnpm install
- run: pnpm build # we don't have any other workflows to test build
- run: pnpm test:spec
Expand All @@ -35,11 +31,7 @@ jobs:
- 0.0.0-experimental-1b1283ad-20241203
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: ./.github/actions/setup
- run: pnpm install
- name: Test ${{ matrix.react }} ${{ matrix.devtools-skip }}
run: |
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/test-old-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ jobs:
- 4.5.5
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- uses: ./.github/actions/setup
- run: pnpm install
- run: pnpm build
- name: Patch for all TS
Expand Down
Loading