83 lines
3.2 KiB
YAML
83 lines
3.2 KiB
YAML
name: PR checks
|
|
|
|
on:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
node:
|
|
name: Web, Agent and knowledge contract
|
|
# The 3090 runs branches from this private repository only.
|
|
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: [self-hosted, linux, x64, xiaoyi-3090]
|
|
timeout-minutes: 30
|
|
env:
|
|
CI: true
|
|
NEXT_TELEMETRY_DISABLED: 1
|
|
steps:
|
|
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
with:
|
|
persist-credentials: false
|
|
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
|
with:
|
|
node-version: '24.22.1'
|
|
package-manager-cache: false
|
|
- name: Install locked dependencies
|
|
id: dependencies
|
|
run: |
|
|
npm ci --legacy-peer-deps --no-audit --no-fund
|
|
npm --prefix apps/detail-agent-pi ci --no-audit --no-fund
|
|
npm run prisma:generate
|
|
- name: TypeScript
|
|
run: npm run typecheck -- --incremental false
|
|
- name: Web tests
|
|
if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }}
|
|
run: npm test -- --maxWorkers=2
|
|
- name: Node script tests
|
|
if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }}
|
|
run: npm run test:scripts
|
|
- name: Agent tests and white-label checks
|
|
if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }}
|
|
run: npm run test:agent
|
|
- name: Knowledge contract drift
|
|
if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }}
|
|
env:
|
|
KB_SOURCE: ${{ vars.XIAOYI_KB_CONTRACT_SOURCE }}
|
|
KB_RELEASE: ${{ vars.XIAOYI_KB_CONTRACT_RELEASE }}
|
|
run: |
|
|
if [[ -z "$KB_SOURCE" && -z "$KB_RELEASE" ]]; then
|
|
echo "No snapshot paths configured. The contract smoke test runs in the Node script suite." >> "$GITHUB_STEP_SUMMARY"
|
|
else
|
|
: "${KB_SOURCE:?Set the source snapshot path}" "${KB_RELEASE:?Set the release snapshot path}"
|
|
node scripts/check-kb-contract-drift.mjs "$KB_SOURCE" "$KB_RELEASE"
|
|
fi
|
|
|
|
rust:
|
|
name: Windows Rust cross-check
|
|
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: [self-hosted, linux, x64, xiaoyi-3090]
|
|
timeout-minutes: 45
|
|
defaults:
|
|
run:
|
|
working-directory: apps/detail-photocraft
|
|
env:
|
|
CARGO_BUILD_JOBS: 4
|
|
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc-win32
|
|
CC_x86_64_pc_windows_gnu: x86_64-w64-mingw32-gcc-win32
|
|
CXX_x86_64_pc_windows_gnu: x86_64-w64-mingw32-g++-win32
|
|
steps:
|
|
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install the Windows Rust target
|
|
run: rustup toolchain install 1.95.0 --profile minimal --target x86_64-pc-windows-gnu
|
|
- name: Check Windows client
|
|
run: rustup run 1.95.0 cargo check --locked --target x86_64-pc-windows-gnu -p photocraft --all-targets
|