chore(deps): bump the dependencies group with 2 updates (#618) #1054
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: lts/* | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run lint | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| node-version: [10.x, 12.x, 14.x, 16.x, 18.x, 20.x, 22.x, 24.x, 25.x] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| # macOS arm64 runners don't ship Node.js 10/12/14, so force x64. | |
| - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| id: calculate_architecture | |
| with: | |
| result-encoding: string | |
| script: | | |
| if ('${{ matrix.os }}' === 'macos-latest' && ('${{ matrix['node-version'] }}' === '10.x' || '${{ matrix['node-version'] }}' === '12.x' || '${{ matrix['node-version'] }}' === '14.x')) { | |
| return "x64" | |
| } else { | |
| return '' | |
| } | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| architecture: ${{ steps.calculate_architecture.outputs.result }} | |
| # Legacy Node (10-16) reinstalls deps after dropping the lockfile, | |
| # so there's nothing for setup-node's npm cache to key on. | |
| cache: ${{ (matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x') && '' || 'npm' }} | |
| # TODO: drop the legacy install + jest steps below once `engines.node` | |
| # is bumped to >= 18. That also makes `jest.config.js`, the jest branch | |
| # of `test/_runner.js`, and `test/polyfill-text-encoding.js` dead code. | |
| # | |
| # The `node:test` based suite needs Node.js 18+; the library itself | |
| # still supports Node.js >= 10.13, so legacy versions run the same test | |
| # files under jest via the runner shim (`test/_runner.js`). jest, memfs | |
| # and the runtime deps are installed ad-hoc so the modern dev toolchain | |
| # (eslint, typescript, prettier) is never required by the legacy leg. | |
| - name: Install jest (Node 10) | |
| if: matrix.node-version == '10.x' | |
| shell: bash | |
| run: | | |
| rm -f package-lock.json | |
| npm config set progress false | |
| yarn add -D jest@^27 memfs@^3 --ignore-scripts --ignore-engines | |
| - name: Install jest (Node 12-16) | |
| if: matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x' | |
| shell: bash | |
| run: | | |
| rm -f package-lock.json | |
| npm config set progress false | |
| npm install -g npm@7 | |
| npm install -D jest@^27 memfs@^3 --ignore-scripts --no-audit --prefer-offline --no-save --no-package-lock | |
| - name: Install dependencies | |
| if: matrix.node-version != '10.x' && matrix.node-version != '12.x' && matrix.node-version != '14.x' && matrix.node-version != '16.x' | |
| run: npm ci | |
| - name: Run tests (legacy via jest) | |
| if: matrix.node-version == '10.x' || matrix.node-version == '12.x' || matrix.node-version == '14.x' || matrix.node-version == '16.x' | |
| run: npx jest --ci | |
| # The built-in coverage lcov reporter and `--test-coverage-include` are | |
| # only available on Node.js 22+, so 18/20 run the suite without | |
| # collecting coverage. | |
| - name: Run tests | |
| if: matrix.node-version == '18.x' || matrix.node-version == '20.x' | |
| run: npm run test:only | |
| - name: Run tests with coverage | |
| if: matrix.node-version == '22.x' || matrix.node-version == '24.x' || matrix.node-version == '25.x' | |
| run: npm run test:coverage | |
| - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| if: matrix.node-version == '22.x' || matrix.node-version == '24.x' || matrix.node-version == '25.x' | |
| with: | |
| files: ./coverage/lcov.info | |
| flags: integration | |
| token: ${{ secrets.CODECOV_TOKEN }} |