From f760db8c05edcd467364900b07ac40ba1b12433c Mon Sep 17 00:00:00 2001 From: zoton2 Date: Thu, 15 Feb 2024 14:04:10 +0100 Subject: [PATCH] GitHub workflow: update for PNPM --- .github/workflows/build.yml | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2bf27c8..e737447e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -92,22 +92,31 @@ jobs: with: node-version: '18' - # Set NPM cache options - - name: Set NPM cache - uses: actions/cache@v3 + # Install pnpm + - uses: pnpm/action-setup@v2 + name: Install pnpm with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- + version: 8 + + # Gets pnpm's store directory (for next step) + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - # Update NPM to the latest version - - name: Update NPM installation - run: npm install -g npm@latest + # Set pnpm cache options + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- - # Install NPM dependencies - - name: Install NPM dependencies - run: npm ci + # Install pnpm dependencies + - name: Install pnpm dependencies + run: pnpm i --frozen-lockfile # Actually build everything - name: Build