ci: fix actions/setup-node version #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 CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 20.9.0 ] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
check-latest: true | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.npm | |
~/.cache | |
key: ${{ runner.os }}-node-${{ hashFiles('**/*.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm ci | |
- name: Type check | |
run: npm run typecheck | |
- name: Lint | |
run: npm run lint | |
- name: Prettier check | |
run: npm run prettier:check | |
- name: Test | |
run: npm test | |
- name: Build | |
run: npm run build | |
- name: Cache artifacts | |
uses: actions/cache@v2 | |
with: | |
path: | | |
dist | |
key: ${{ runner.os }}-node-${{ hashFiles('dist/**/*') }} | |
restore-keys: | | |
${{ runner.os }}-node- |