Skip to content

Commit

Permalink
Switch to pnpm
Browse files Browse the repository at this point in the history
 - needed to add some peer deps that we were missing
 - needed to prevent a compatible upgrade to markdown-link-extractor because it made node-tests hundreds of times slower
  • Loading branch information
ef4 committed Nov 6, 2024
1 parent 4563b16 commit 5ef8179
Show file tree
Hide file tree
Showing 5 changed files with 17,619 additions and 36,928 deletions.
24 changes: 24 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup node and pnpm
description: Setup node and install dependencies using pnpm
inputs:
use_lockfile:
description: 'Whether to use the lockfile vs latest floating dependencies'
required: false
default: 'true'
use_pinned_node:
description: 'Whether to use the node version defined in .npmrc'
required: false
default: 'false'
runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install ${{ fromJSON('{"false":"--no-lockfile", "true":"--frozen-lockfile"}')[inputs.use_lockfile] }}
shell: bash
42 changes: 7 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
pull_request:

env:
NODE_VERSION: 20
NODE_OPTIONS: '--max_old_space_size=4096'

jobs:
Expand All @@ -17,17 +16,8 @@ jobs:
timeout-minutes: 7
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@9
- run: npm ci

uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Lint
run: npm run lint

Expand All @@ -37,17 +27,8 @@ jobs:
timeout-minutes: 7
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v3

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
cache: 'npm'
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@9
- run: npm ci

uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Test
uses: percy/[email protected]
with:
Expand All @@ -61,16 +42,7 @@ jobs:
timeout-minutes: 7
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v2

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
cache: 'npm'
node-version: ${{ env.NODE_VERSION }}

- run: npm i -g npm@9
- run: npm ci

uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Test
run: npm run test:node
run: pnpm run test:node
Loading

0 comments on commit 5ef8179

Please sign in to comment.