chore: upgrade to node 22 (#30) #32
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | |
name: Node.js CI | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Use Node | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build library | |
run: npm run build | |
test-unit: | |
name: Unit tests | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Use Node | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build library | |
run: npm run build | |
- name: Run unit tests | |
run: npm test | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Use Node | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 4.1.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Lint code | |
run: npm run prettier:check && npm run lint:check |