Co-authored-by: Michael Genson <genson.michael@gmail.com>
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Frontend Lint and Test
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
ref:
|
|
required: false
|
|
type: string
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout 🛎
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: ${{ inputs.ref || github.sha }}
|
|
|
|
# Work around pnpm/action-setup v6 resolving the wrong version from package.json
|
|
# https://github.com/pnpm/action-setup/issues/227
|
|
- name: Read pnpm version
|
|
id: pnpm-version
|
|
run: 'echo "version=$(jq --raw-output ''.packageManager | split("@")[1]'' package.json)" >> "$GITHUB_OUTPUT"'
|
|
working-directory: "frontend"
|
|
- uses: pnpm/action-setup@v6
|
|
with:
|
|
version: ${{ steps.pnpm-version.outputs.version }}
|
|
|
|
- name: Setup node env 🏗
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: "pnpm"
|
|
cache-dependency-path: "**/pnpm-lock.yaml"
|
|
|
|
- name: Install dependencies 👨🏻💻
|
|
run: pnpm install --prefer-offline
|
|
working-directory: "frontend"
|
|
|
|
- name: Prepare nuxt 🚀
|
|
run: pnpm nuxt prepare
|
|
working-directory: "frontend"
|
|
|
|
- name: Run linter 👀
|
|
run: pnpm lint --max-warnings=0
|
|
working-directory: "frontend"
|
|
|
|
- name: Run tests 🧪
|
|
run: pnpm test:ci
|
|
working-directory: "frontend"
|