Skip to content

chore: add test step for next version on GH Action #12

chore: add test step for next version on GH Action

chore: add test step for next version on GH Action #12

Workflow file for this run

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
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Initialize submodules
run: git submodule update --init
- 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
with:
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- 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