chore: establish V1.1 recovery baseline
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
name: CI/CD Pipeline
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, develop]
|
||||
pull_request:
|
||||
branches: [main, develop]
|
||||
|
||||
jobs:
|
||||
backend:
|
||||
name: Backend Build & Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
working-directory: backend
|
||||
|
||||
- name: Build and Test
|
||||
working-directory: backend
|
||||
run: mvn verify -B
|
||||
|
||||
- name: Upload Test Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: backend-test-results
|
||||
path: backend/target/surefire-reports/
|
||||
|
||||
admin-web:
|
||||
name: Admin Web Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: admin-web/pnpm-lock.yaml
|
||||
|
||||
- name: Install Dependencies
|
||||
working-directory: admin-web
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build
|
||||
working-directory: admin-web
|
||||
run: pnpm build
|
||||
|
||||
miniapp:
|
||||
name: Mini Program Compile Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install Dependencies
|
||||
working-directory: miniapp
|
||||
run: npm install
|
||||
|
||||
- name: TypeScript Compile Check
|
||||
working-directory: miniapp
|
||||
run: npx tsc --noEmit
|
||||
|
||||
migration:
|
||||
name: Migration Validation
|
||||
runs-on: ubuntu-latest
|
||||
needs: [backend]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Validate Flyway migrations
|
||||
working-directory: backend
|
||||
run: |
|
||||
# 验证 migration SQL 语法(通过检查文件是否存在且非空)
|
||||
find src/main/resources/db/migration -name "V*.sql" -type f | sort | while read f; do
|
||||
echo "Validating: $f"
|
||||
if [ ! -s "$f" ]; then
|
||||
echo "ERROR: Empty migration file: $f"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
echo "All migration files validated."
|
||||
Reference in New Issue
Block a user