fix(js): test on node versions 20 through 22; 23 is currently broken #1995 #3668
This file contains 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
# Copyright 2024 Google LLC | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Build Check (Run npm run build everywhere locally if this fails) | |
on: pull_request | |
env: | |
GITHUB_PULL_REQUEST_HEAD_SHA: ${{ github.event.pull_request.head.sha }} | |
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
jobs: | |
build: | |
name: Run build tasks (Node ${{ matrix.node-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: ['20', '21', '22'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v3 | |
- name: Set up node v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run build script | |
run: pnpm build | |
- name: Run js tests | |
run: pnpm test:js | |
- name: Validate working directory is clean | |
run: .github/workflows/scripts/ensure-clean-working-tree.sh |