diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 37d94cb..6bb073d 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -12,6 +12,9 @@ on: - main jobs: build-and-test: + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -19,14 +22,14 @@ jobs: submodules: true - uses: actions/setup-node@v4 with: - node-version: "18.x" + node-version: "${{ matrix.node-version }}" - name: cache node modules uses: actions/cache@v4 with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS - key: npm-${{ hashFiles('package-lock.json') }} + key: npm-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} restore-keys: | - npm-${{ hashFiles('package-lock.json') }} + npm-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} npm- - run: npm ci - run: npm test