Replace custom MSAL cache plugin with msal-node-extensions #7045
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check PR | |
| on: pull_request | |
| env: | |
| NODE_VERSION: &node_version 24 | |
| jobs: | |
| build: | |
| if: github.repository_owner == 'pnp' | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, windows-latest, ubuntu-latest] | |
| node: [*node_version] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Cache node modules | |
| id: cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| **/node_modules | |
| key: node_modules-${{ matrix.os }}-${{ matrix.node }}-${{ hashFiles('npm-shrinkwrap.json') }} | |
| - name: Restore dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Compress output (non-Windows) | |
| if: matrix.os != 'windows-latest' | |
| run: tar -cvf build.tar --exclude node_modules ./ | |
| - name: Compress output (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: 7z a -ttar -xr!node_modules -r build.tar . | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: build-${{ matrix.os }}-${{ matrix.node }} | |
| path: build.tar | |
| test: | |
| if: github.repository_owner == 'pnp' | |
| needs: build | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, windows-latest, ubuntu-latest] | |
| # node versions to run tests on | |
| nodeRun: [*node_version] | |
| # node version on which code was built and should be tested | |
| nodeBuild: [*node_version] | |
| include: | |
| - os: ubuntu-latest | |
| nodeRun: 20 | |
| nodeBuild: *node_version | |
| - os: ubuntu-latest | |
| nodeRun: 22 | |
| nodeBuild: *node_version | |
| - os: ubuntu-latest | |
| nodeRun: 25 | |
| nodeBuild: *node_version | |
| steps: | |
| - name: Configure pagefile | |
| if: matrix.os == 'windows-latest' | |
| uses: al-cheb/configure-pagefile-action@v1.5 | |
| with: | |
| minimum-size: 16GB | |
| disk-root: "C:" | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: build-${{ matrix.os }}-${{ matrix.nodeBuild }} | |
| - name: Unpack build artifact (non-Windows) | |
| if: matrix.os != 'windows-latest' | |
| run: tar -xvf build.tar && rm build.tar | |
| - name: Unpack build artifact (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: 7z x build.tar && del build.tar | |
| - name: Use Node.js ${{ matrix.nodeRun }} | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ matrix.nodeRun }} | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Cache node modules | |
| id: cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| **/node_modules | |
| key: node_modules-${{ matrix.os }}-${{ matrix.nodeBuild }}-${{ hashFiles('npm-shrinkwrap.json') }} | |
| - name: Restore dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Cache .eslintcache | |
| if: matrix.nodeRun == matrix.nodeBuild | |
| id: eslintcache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| .eslintcache | |
| key: eslintcache-${{ matrix.os }}-${{ hashFiles('npm-shrinkwrap.json', 'eslint.config.mjs') }} | |
| - name: Test with coverage | |
| # we run coverage only on Node that was used to build | |
| if: matrix.nodeRun == matrix.nodeBuild | |
| run: npm test | |
| env: | |
| NODE_OPTIONS: '--max_old_space_size=4096' | |
| - name: Test without coverage | |
| # we want to run tests on older Node versions to ensure that code works | |
| if: matrix.nodeRun != matrix.nodeBuild | |
| run: npm run test:test | |
| - name: Compress output (non-Windows) | |
| if: matrix.nodeRun == matrix.nodeBuild && matrix.os != 'windows-latest' && always() | |
| run: tar -cvf coverage.tar coverage | |
| - name: Compress output (Windows) | |
| if: matrix.nodeRun == matrix.nodeBuild && matrix.os == 'windows-latest' && always() | |
| run: 7z a -ttar -r coverage.tar coverage | |
| - uses: actions/upload-artifact@v7 | |
| if: matrix.nodeRun == matrix.nodeBuild && always() | |
| with: | |
| name: coverage-${{ matrix.os }}-${{ matrix.nodeRun }} | |
| path: coverage.tar | |
| test_docs: | |
| if: github.repository_owner == 'pnp' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| # Number of commits to fetch. 0 indicates all history for all branches and tags. Default: 1 | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Cache node modules | |
| id: cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| **/docs/node_modules | |
| key: docs_node_modules-${{ hashFiles('./docs/package-lock.json') }} | |
| - name: Restore dependencies | |
| if: steps.cache.outputs.cache-hit != 'true' | |
| run: npm ci | |
| working-directory: docs | |
| - name: Prepare docs versioning | |
| run: node scripts/create-docs-versioning.mjs | |
| - name: Build docs | |
| run: npm run build | |
| working-directory: docs |