Files
ttstd-infinite-canvas/.github/workflows/quality.yml
ddCat bb2a79d365 feat(payment): 虎皮椒聚合支付 - 官方插件与跨平台可执行文件
新增 xunhupay 官方包,支付 RPC 与宿主只保留订单和验签边界;官方支付包同时带上各系统 provider,避免把 Linux ELF 当成本机入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 23:32:11 +08:00

117 lines
3.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Quality checks
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
backend:
name: Backend checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: backend/go.mod
cache: true
- name: Check formatting
run: test -z "$(gofmt -l .)"
- name: Run Go tests
run: go test ./...
payment-plugins:
name: Payment plugin artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify canonical payment packages
env:
PAYMENT_PLUGIN_SMOKE_TEST: "1"
run: sh plugin-packages/verify-payment-packages.sh --all linux amd64
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Build and execute payment packages for every image platform
run: >-
docker buildx build
--platform linux/amd64,linux/arm64
--target payment-package-smoke
--file backend/Dockerfile
.
web:
name: Web checks
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.9
- name: Reject leftover package manager lockfiles
working-directory: ${{ github.workspace }}
run: |
leftover=0
for file in web/pnpm-lock.yaml web/package-lock.json web/yarn.lock; do
if [ -f "$file" ]; then
echo "forbidden lockfile: $file"
leftover=1
fi
done
if [ "$leftover" -ne 0 ]; then
echo "web installs from bun.lock only"
exit 1
fi
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Check formatting
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
changed_files=()
repo_prefix="$(git rev-parse --show-prefix)"
while IFS= read -r -d '' file; do
case "$file" in
*.css|*.html|*.json|*.js|*.jsx|*.md|*.mdx|*.mjs|*.cjs|*.ts|*.tsx|*.yaml|*.yml)
base_path="${repo_prefix}${file}"
if git cat-file -e "$BASE_SHA:$base_path" 2>/dev/null \
&& ! diff -q \
<(git show "$BASE_SHA:$base_path") \
<(git show "$BASE_SHA:$base_path" | bunx prettier --ignore-path /dev/null --stdin-filepath "$file") \
>/dev/null; then
echo "Skipping legacy unformatted file: $file"
continue
fi
changed_files+=("$file")
;;
esac
done < <(git diff --relative --name-only --diff-filter=ACMR -z "$BASE_SHA" "$GITHUB_SHA" -- .)
if (( ${#changed_files[@]} > 0 )); then
bunx prettier --check "${changed_files[@]}"
else
echo "No changed web files require formatting checks."
fi
- name: Typecheck
run: bun run typecheck
- name: Lint retired Ant Design APIs
run: bun run lint
- name: Run tests
run: bun run test
# ubuntu-latest 预装 google-chrome;脚本的解析顺序已覆盖该路径,
# 因此不引入第三方 setup action,也不需要任何 secret。
- name: Director P0 Chrome E2E
run: |
google-chrome --version || chromium --version
bun run test:director:e2e