Files
boojack dcf08b5911 chore(ci): share Go and web setup through composite actions
Add .github/actions/setup-go (Go version from go.mod) and
.github/actions/setup-web (pnpm from web/package.json, Node 24,
frozen install), and use them in every workflow that installed the
toolchains by hand. Drop the per-workflow version env vars and the
redundant pnpm store cache steps that duplicated setup-node's cache.
2026-10-27 20:22:30 +08:00

49 lines
934 B
YAML

name: Frontend Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
paths:
- "web/**"
- ".github/actions/setup-web/**"
- ".github/workflows/frontend-tests.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup web
uses: ./.github/actions/setup-web
- name: Run lint
working-directory: web
run: pnpm lint
- name: Run unit tests
working-directory: web
run: pnpm test
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup web
uses: ./.github/actions/setup-web
- name: Build frontend
working-directory: web
run: pnpm build