Skip to content

ci: cache nodejs versions (#315) #518

ci: cache nodejs versions (#315)

ci: cache nodejs versions (#315) #518

Workflow file for this run

name: Test
on:
push:
branches: [develop]
pull_request:
branches: [master, develop, next]
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true
- name: Restore Node.js versions
id: cache-nodejs
uses: actions/cache/restore@v3
with:
path: /home/runner/.cache/nve
key: ${{ runner.os }}-nodejs-${{ hashFiles('tests/index.ts') }}
- name: Test
run: pnpm test
- name: Save Node.js versions
uses: actions/cache/save@v3
with:
path: /home/runner/.cache/nve
key: ${{ steps.cache-nodejs.outputs.cache-primary-key }}
- name: Type check
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm type-check
- name: Lint
if: ${{ matrix.os == 'ubuntu-latest' }}
run: pnpm lint