name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node: [14, 16, 18]
    steps:
      - name: Check out repository
        uses: actions/checkout@v3
        with:
          submodules: true

      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node }}
          check-latest: true
          cache: npm

      - name: Cache Node modules
        id: cache-node-modules
        uses: actions/cache@v3
        with:
          path: node_modules
          key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

      - name: Install dependencies
        if: steps.cache-node-modules.outputs.cache-hit != 'true'
        run: npm ci

      - name: Run tests
        run: npm test

name: CI
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node: [14, 16, 18]
    steps:
      - name: Check out repository
        uses: actions/checkout@v3
        with:
          submodules: true

      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node }}
          check-latest: true
          cache: npm

      - name: Cache Node modules
        id: cache-node-modules
        uses: actions/cache@v3
        with:
          path: node_modules
          key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}

      - name: Install dependencies
        if: steps.cache-node-modules.outputs.cache-hit != 'true'
        run: npm ci

      - name: Run tests
        run: npm test

Add the Node.js version to caches in CI
Add the Node.js version to caches in CI
