refactor: use composite action for node/pnpm setup

This commit is contained in:
taroj1205 2025-06-18 13:52:34 +12:00
parent ce72a77f02
commit 8e4107d7f4
No known key found for this signature in database
GPG key ID: 0FCB6CFFE0981AB7
2 changed files with 10 additions and 37 deletions

View file

@ -21,6 +21,7 @@ runs:
${{ runner.os }}-turbo-
- name: Restore node_modules cache
id: node-modules-cache
uses: actions/cache@v4
with:
path: |
@ -40,3 +41,8 @@ runs:
with:
version: 10.11.0
run_install: false
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
shell: bash
run: pnpm install --frozen-lockfile

View file

@ -42,44 +42,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Restore Turborepo cache
id: turbo-cache
uses: actions/cache@v4
- name: Setup Node.js and pnpm
uses: ./.github/composite-actions/setup-node-pnpm
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
lookup-only: true
- name: Restore node_modules cache
id: node-modules-cache
uses: actions/cache@v4
with:
path: |
node_modules
*/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-node-modules-
lookup-only: true
- name: Setup Node.js
if: steps.node-modules-cache.outputs.cache-hit != 'true'
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Setup pnpm
if: steps.node-modules-cache.outputs.cache-hit != 'true'
uses: pnpm/action-setup@v4
with:
version: 10.11.0
run_install: false
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: pnpm install --frozen-lockfile
turbo-cache-key: ${{ runner.os }}-turbo-${{ github.sha }}
node-modules-cache-key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
eslint:
name: ESLint