chore: add test step for next version on GH Action #3
Workflow file for this run
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: Build Next Package | |
on: | |
pull_request: | |
paths: | |
- 'next/**' # Only run if files in next/ directory change | |
- '.github/workflows/build-next.yml' # Also run if this workflow file changes | |
jobs: | |
dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: 'next/.nvmrc' | |
cache: 'npm' | |
- name: Cache PNPM dependencies | |
uses: actions/cache@v3 | |
id: cache-next | |
with: | |
path: next/node_modules | |
key: ${{ runner.os }}-pnpm-next-${{ hashFiles('next/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
if: steps.cache-next.outputs.cache-hit != 'true' | |
run: cd next && pnpm install | |
test: | |
runs-on: ubuntu-latest | |
needs: [dependencies] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 9 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: 'next/.nvmrc' | |
cache: 'pnpm' | |
cache-dependency-path: next/pnpm-lock.yaml | |
- name: Get cached PNPM dependencies | |
uses: actions/cache@v3 | |
with: | |
path: next/node_modules | |
key: ${{ runner.os }}-pnpm-next-${{ hashFiles('next/pnpm-lock.yaml') }} | |
- name: Tests | |
run: cd next && pnpm test |