pkg: install cmake-node on ci. #2
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
name: Node.js | |
on: [push, pull_request] | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
- name: Install tools | |
run: npm install --location=global bslint | |
- name: Install bslintrc | |
run: npm install --ignore-scripts bslintrc | |
- name: Lint | |
run: npm run lint | |
gyp: | |
name: Test with node-gyp | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [14.x, 16.x, 18.x, 20.x, 22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
# Pythong 3.10->3.11 broke node-gyp. This upgrades node-gyp for older nodejs. | |
# https://github.com/nodejs/node-gyp/issues/2219 | |
- name: Update npm. | |
if: contains(matrix.node, '14.x') | |
run: npm i -g npm@9 | |
- name: Install dependencies | |
run: npm install | |
- name: Test | |
run: npm test | |
cmake: | |
name: Test with cmake-node | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [14.x, 16.x, 18.x, 20.x, 22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install cmake node and deps | |
run: npm install --ignore-scripts cmake-node | |
- name: Rebuild using cmake | |
run: npx cmake-node rebuild --production | |
- name: Test | |
run: npm test |