Files
next-learn/.github/workflows/test.yml
2026-05-21 21:19:56 +00:00

34 lines
1.0 KiB
YAML

name: test
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Cancel running workflows
uses: styfle/cancel-workflow-action@0.13.0
with:
access_token: ${{ github.token }}
- name: Checkout repo
uses: actions/checkout@v4
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Enable pnpm
run: corepack enable pnpm && corepack install
- name: Get pnpm store directory
id: pnpm-store
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test