Fix build failure: upgrade Node 8.x → 20.x for macOS arm64 compatibility and add PR trigger #29
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: build | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| jobs: | |
| build: | |
| runs-on: macOS-latest | |
| strategy: | |
| matrix: | |
| # Updated from [8.x, 10.x, 12.x] to [20.x] to fix build failure on macOS arm64 runners. | |
| # Node 8.x is not available on macOS arm64 architecture. | |
| node-version: [20.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: npm install, build, and test | |
| run: | | |
| npm install | |
| npm run build --if-present | |
| npm test | |
| env: | |
| CI: true |