skillhub/.github/workflows/pr-tests.yml
dongmucat 55b38051ce
Some checks failed
Deploy Docs / build (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
chore(deps): bump vite/postcss/picomatch/flatted/esbuild to patch Dependabot alerts
* chore(deps): bump vite/postcss/picomatch/flatted/esbuild to patch Dependabot alerts

web/:
- pnpm.overrides force vite>=6.4.2, postcss>=8.5.10, picomatch>=2.3.2/>=4.0.4, flatted>=3.4.2
- bump devDeps vite to ^6.4.2 and postcss to ^8.5.10

docs/skillhub/:
- npm overrides force vite^6.4.2, postcss^8.5.10, esbuild^0.25.0
- regenerate package-lock.json

Resolves Dependabot alerts:
- web: GHSA-p9ff-h696-f583 (vite high), GHSA-rf6f-7fwh-wjgh (flatted high),
       GHSA-qx2v-qp2m-jg93 (postcss), GHSA-4w7w-66w2-5vf9 (vite),
       GHSA-3v7f-55p6-f55p (picomatch x2)
- docs: GHSA-67mh-4wv8-2f99 (esbuild), GHSA-qx2v-qp2m-jg93 (postcss),
        GHSA-4w7w-66w2-5vf9 (vite)

* chore(deps): bump brace-expansion and add docs-build PR check

web/:
- pnpm.overrides force brace-expansion>=1.1.13 and >=2.0.3
  to address GHSA-f886-m6hf-6m8v (transitive via eslint/typescript-eslint -> minimatch)
- pnpm-lock.yaml resolves brace-expansion 1.1.15 / 2.1.1

ci:
- add docs-build job to pr-tests.yml, gated by docs/skillhub/** path filter
  so docs-only PRs and dependency overrides on docs are exercised before merge
2026-05-28 10:17:27 +08:00

101 lines
2.4 KiB
YAML

name: PR Tests
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch:
concurrency:
group: pr-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
web-tests:
name: Web Build And Test
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Build frontend
run: make build-frontend
- name: Run frontend unit tests
run: make test-frontend
server-tests:
name: Server Unit Tests
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: maven
- name: Ensure Maven wrapper is executable
run: chmod +x server/mvnw
- name: Run backend unit tests
run: make test-backend
docs-build:
name: Docs Build
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Detect docs changes
id: changed
uses: dorny/paths-filter@v3
with:
filters: |
docs:
- 'docs/skillhub/**'
- '.github/workflows/pr-tests.yml'
- name: Set up Node.js
if: steps.changed.outputs.docs == 'true'
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: docs/skillhub/package-lock.json
- name: Install docs dependencies
if: steps.changed.outputs.docs == 'true'
run: cd docs/skillhub && npm ci
- name: Build VitePress site
if: steps.changed.outputs.docs == 'true'
run: cd docs/skillhub && npm run build