ci(node): test against node 20 #8001
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
# GitHub Actions workflow | |
# to test Node.js bindings. | |
name: "node.js tests" | |
# Cancel previously started workflow runs | |
# when the branch is updated. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-14, windows-latest] | |
node: ["18", "20"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- if: matrix.os == 'macos-14' | |
run: sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer | |
- name: System info | |
run: | | |
rustc -vV | |
rustup -vV | |
cargo -vV | |
npm --version | |
node --version | |
- name: Cache node modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ env.APPDATA }}/npm-cache | |
~/.npm | |
key: ${{ matrix.os }}-node-${{ hashFiles('**/package.json') }} | |
- name: Cache cargo index | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry/ | |
~/.cargo/git | |
target | |
key: ${{ matrix.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-2 | |
- name: Install dependencies & build | |
if: steps.cache.outputs.cache-hit != 'true' | |
working-directory: node | |
run: npm install --verbose | |
- name: Test | |
timeout-minutes: 10 | |
working-directory: node | |
run: npm run test | |
env: | |
CHATMAIL_DOMAIN: ${{ secrets.CHATMAIL_DOMAIN }} | |
NODE_OPTIONS: "--force-node-api-uncaught-exceptions-policy=true" |