Skip to content

Commit

Permalink
Move node.js & pnpm setup into a separate action
Browse files Browse the repository at this point in the history
  • Loading branch information
decs committed Jan 28, 2024
1 parent a81e4fa commit fcbe287
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 50 deletions.
12 changes: 12 additions & 0 deletions .github/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Setup requirements
runs:
using: 'composite'
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
62 changes: 12 additions & 50 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@ name: ci
on:
pull_request:
push:
branches:
- monorepo

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Setup requirements
uses: ../setup
- name: Checkout source code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: pnpm install
- name: Lint library
Expand Down Expand Up @@ -53,14 +45,8 @@ jobs:
name: Test bundling with Vite
runs-on: ubuntu-latest
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup requirements
uses: ../setup
- name: Create a Vite project
run: pnpm create vite sample --template vanilla-ts
- name: Download package
Expand Down Expand Up @@ -88,14 +74,8 @@ jobs:
name: Test bundling with Webpack
runs-on: ubuntu-latest
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup requirements
uses: ../setup
- name: Create a Next.js project
run: pnpm create next-app sample --ts --eslint --tailwind --src-dir --app --import-alias="@/*"
- name: Download package
Expand Down Expand Up @@ -125,14 +105,8 @@ jobs:
name: Test bundling with Turbopack
runs-on: ubuntu-latest
steps:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup requirements
uses: ../setup
- name: Create a Next.js project
run: pnpm create next-app sample --ts --eslint --tailwind --src-dir --app --import-alias="@/*"
- name: Download package
Expand Down Expand Up @@ -190,16 +164,10 @@ jobs:
needs.check_for_version_upgrade.outputs.is_pre_release == 'true'
)
steps:
- name: Setup requirements
uses: ../setup
- name: Checkout source code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Skip GitHub actions
run: rm -r .github
- name: Remove deno-dist branch if it exists
Expand Down Expand Up @@ -246,16 +214,10 @@ jobs:
needs.check_for_version_upgrade.outputs.is_pre_release == 'true'
)
steps:
- name: Setup requirements
uses: ../setup
- name: Checkout source code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: pnpm install
- name: Build library
Expand Down

0 comments on commit fcbe287

Please sign in to comment.