From 39b3534085061ea24fe59f948fcec49083377ec3 Mon Sep 17 00:00:00 2001 From: Jacob Cable Date: Fri, 9 Aug 2024 08:44:05 +0100 Subject: [PATCH] ci: switch to pnpm on ci --- .github/workflows/readmes-updated.yml | 43 ++++++++++----------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/.github/workflows/readmes-updated.yml b/.github/workflows/readmes-updated.yml index bb1826869..74e94f6d9 100644 --- a/.github/workflows/readmes-updated.yml +++ b/.github/workflows/readmes-updated.yml @@ -29,47 +29,34 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 8 + run_install: true + - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: 18 - cache: "npm" - cache-dependency-path: "**/functions/package-lock.json" - - - name: Set up global dependencies directory - id: global-deps-setup - run: | - mkdir -p ~/.npm-global - npm config set prefix '~/.npm-global' - echo "::set-output name=dir::$(npm config get prefix)" - - - name: Cache global dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.global-deps-setup.outputs.dir }} - key: - ${{ runner.os }}-npm-global-deps-${{ - hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-npm-global-deps- + cache: "pnpm" - - name: Install Firebase and Lerna - run: | - echo "${{ steps.global-deps-setup.outputs.dir }}/bin" >> $GITHUB_PATH - npm install -g firebase-tools lerna + - name: Install Firebase + run: pnpm install -g firebase-tools - name: Install local dependencies - run: npm ci + run: pnpm clean && pnpm install - - name: Run Lerna generate-readme - run: lerna run --parallel generate-readme + - name: Run generate-readme + run: pnpm run --parallel generate-readme - - name: Check READMEs are up to date and push changes if possible. + - name: Check READMEs are up to date and push changes if possible run: | changed_files=$(git status -s -- '**/README.md' | cut -c4-) if [[ ! -z "$changed_files" ]]; then echo "Changes detected in README.md files:" echo "$changed_files" - echo "Please run 'lerna run --parallel generate-readme' locally and commit the changes." + echo "Please run 'pnpm run generate-readme' locally and commit the changes." exit 1 fi