Skip to content

Commit

Permalink
Add pnpm setup with cache
Browse files Browse the repository at this point in the history
  • Loading branch information
imxeno committed May 18, 2024
1 parent 567c447 commit 5fd3863
Showing 1 changed file with 55 additions and 6 deletions.
61 changes: 55 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
NODE_VERSION: 20
PNPM_VERSION: 8

jobs:
build:
Expand All @@ -22,8 +23,24 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: pnpm install
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Build
run: pnpm build
Expand All @@ -39,8 +56,24 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: pnpm install
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Run format
run: pnpm format
Expand All @@ -56,8 +89,24 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: pnpm install
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ env.PNPM_VERSION }}
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Run lint
run: pnpm lint

0 comments on commit 5fd3863

Please sign in to comment.