From ffbd18238f0e2f26e3cbef299b9d65368f72ad78 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Fri, 10 Sep 2021 15:27:06 +0530 Subject: fix: 'recipes' (using 'pnpm') will coexist with 'ferdi' (using 'npm') (#1905) backported from https://github.com/getferdi/ferdi/pull/1826 Co-authored-by: Markus Hatvan --- .github/workflows/dependency-updates.yml | 13 +++++++++ .github/workflows/ferdi-builds.yml | 45 +++++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 3 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 5d7d64efc..aa3fe6d39 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -22,6 +22,7 @@ jobs: - name: Set env vars run: | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV + echo "PNPM_CACHE=$HOME/.pnpm-store" >> $GITHUB_ENV - name: Checkout code along with submodules uses: actions/checkout@v2 with: @@ -40,10 +41,22 @@ jobs: restore-keys: | ${{ runner.os }}-14.17-build-${{ env.cache-name }}- ${{ runner.os }}-14.17-build- + - name: Cache .pnpm-store + uses: actions/cache@v2 + env: + cache-name: cache-pnpm-store + with: + path: ${{ env.PNPM_CACHE }} + key: ${{ runner.os }}-14.17-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Use Node.js 14.17.6 uses: actions/setup-node@v2 with: node-version: 14.17.6 + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: 6.14.7 + run_install: true - name: Uninstall locally and reinstall global npm modules run: | npm uninstall node-gyp diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml index c1312fb92..820725a1d 100644 --- a/.github/workflows/ferdi-builds.yml +++ b/.github/workflows/ferdi-builds.yml @@ -88,6 +88,7 @@ jobs: - name: Set env vars run: | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV + echo "PNPM_CACHE=$HOME/.pnpm-store" >> $GITHUB_ENV echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV @@ -116,6 +117,13 @@ jobs: restore-keys: | ${{ runner.os }}-14.17-build-${{ env.cache-name }}- ${{ runner.os }}-14.17-build- + - name: Cache .pnpm-store + uses: actions/cache@v2 + env: + cache-name: cache-pnpm-store + with: + path: ${{ env.PNPM_CACHE }} + key: ${{ runner.os }}-14.17-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Cache electron modules uses: actions/cache@v2 env: @@ -138,6 +146,11 @@ jobs: run: | sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* sudo xcode-select -s "/Applications/Xcode_12.4.app" + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: 6.14.7 + run_install: true - name: Uninstall locally and reinstall global npm modules run: | npm uninstall node-gyp @@ -148,7 +161,7 @@ jobs: - name: Install node dependencies recursively run: npx lerna bootstrap - name: Package recipes - run: npm i && npm run package + run: pnpm i && pnpm run package working-directory: ./recipes - name: Run linter and tests run: npm run lint && npm run test @@ -186,6 +199,7 @@ jobs: - name: Set env vars run: | echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV + echo "PNPM_CACHE=$HOME/.pnpm-store" >> $GITHUB_ENV echo "ELECTRON_CACHE=$HOME/.cache/electron" >> $GITHUB_ENV echo "ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder" >> $GITHUB_ENV echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV @@ -214,6 +228,13 @@ jobs: restore-keys: | ${{ runner.os }}-14.17-build-${{ env.cache-name }}- ${{ runner.os }}-14.17-build- + - name: Cache .pnpm-store + uses: actions/cache@v2 + env: + cache-name: cache-pnpm-store + with: + path: ${{ env.PNPM_CACHE }} + key: ${{ runner.os }}-14.17-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Cache electron modules uses: actions/cache@v2 env: @@ -232,6 +253,11 @@ jobs: uses: actions/setup-node@v2 with: node-version: 14.17.6 + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: 6.14.7 + run_install: true - name: Uninstall locally and reinstall global npm modules run: | npm uninstall node-gyp @@ -245,7 +271,7 @@ jobs: run: echo "PACKAGE_VERSION=$(node -p 'require("./package.json").version')" >> $GITHUB_ENV shell: bash - name: Package recipes - run: npm i && npm run package + run: pnpm i && pnpm run package working-directory: ./recipes - name: Run linter and tests run: npm run lint && npm run test @@ -300,6 +326,7 @@ jobs: run: | echo "HOME=$USERPROFILE" >> $GITHUB_ENV echo "NPM_CACHE=$USERPROFILE\.npm" >> $GITHUB_ENV + echo "PNPM_CACHE=$USERPROFILE\.pnpm-store" >> $GITHUB_ENV echo "ELECTRON_CACHE=$USERPROFILE\.cache\electron" >> $GITHUB_ENV echo "ELECTRON_BUILDER_CACHE=$USERPROFILE\.cache\electron-builder" >> $GITHUB_ENV echo "MANUAL_REBUILD_ON_NIGHTLY=${{ github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]') }}" >> $GITHUB_ENV @@ -329,6 +356,13 @@ jobs: restore-keys: | ${{ runner.os }}-14.17-build-${{ env.cache-name }}- ${{ runner.os }}-14.17-build- + - name: Cache .pnpm-store + uses: actions/cache@v2 + env: + cache-name: cache-pnpm-store + with: + path: ${{ env.PNPM_CACHE }} + key: ${{ runner.os }}-14.17-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} - name: Cache electron modules uses: actions/cache@v2 env: @@ -347,6 +381,11 @@ jobs: uses: actions/setup-node@v2 with: node-version: 14.17.6 + - name: Install pnpm + uses: pnpm/action-setup@v2.0.1 + with: + version: 6.14.7 + run_install: true - name: Uninstall locally and reinstall global npm modules run: | npm uninstall node-gyp @@ -360,7 +399,7 @@ jobs: run: npx lerna bootstrap shell: bash - name: Package recipes - run: npm i && npm run package + run: pnpm i && pnpm run package working-directory: ./recipes shell: bash - name: Run linter and tests -- cgit v1.2.3-54-g00ecf