From 903c2da2d1f5aeeaf3cb983c0e4e4c0612acfe52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=80=E1=85=B5=E1=86=B7=E1=84=83=E1=85=A5=E1=86=A8?= =?UTF-8?q?=E1=84=92=E1=85=A7=E1=86=AB?= Date: Tue, 16 Jan 2024 21:02:36 +0900 Subject: [PATCH] ci: Update Node.js CI with pnpm and cache Update ci.yml to use pnpm for installation and caching. Add steps to checkout, install pnpm, get store directory, and setup cache. made by ollama-commit --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a66f29e..c886107 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,25 +1,37 @@ name: Node.js CI with pnpm on: - push: - branches: [main] - pull_request: - branches: [main] + - push + - pull_request jobs: build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Node.js - uses: actions/setup-node@v2 + - name: Checkout + uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2 + name: Install pnpm with: - node-version: "16.x" - cache: "pnpm" - - name: Install pnpm - run: npm install -g pnpm + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + 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: Install dependencies run: pnpm install --frozen-lockfile + - name: Build run: pnpm run build