mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-21 04:46:26 +00:00
120 lines
3.5 KiB
YAML
120 lines
3.5 KiB
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
pull_request:
|
|
branches: [main, develop]
|
|
|
|
jobs:
|
|
build-and-test:
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [20.x]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 9.9.0
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
shell: bash
|
|
run: |
|
|
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.STORE_PATH }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies (workspace recursive)
|
|
run: pnpm -r install --frozen-lockfile
|
|
|
|
- name: Test WeChat Mini Program dev mode
|
|
shell: bash
|
|
run: |
|
|
echo "Testing WeChat Mini Program dev mode startup..."
|
|
timeout 30s pnpm dev:mp-weixin || true
|
|
echo "✅ WeChat Mini Program dev mode test completed"
|
|
|
|
- name: Test H5 dev mode
|
|
shell: bash
|
|
run: |
|
|
echo "Testing H5 dev mode startup..."
|
|
timeout 30s pnpm dev:h5 || true
|
|
echo "✅ H5 dev mode test completed"
|
|
|
|
- name: Test iOS dev mode
|
|
shell: bash
|
|
run: |
|
|
echo "Testing iOS dev mode startup..."
|
|
timeout 30s pnpm dev:app-ios || true
|
|
echo "✅ iOS dev mode test completed"
|
|
|
|
- name: Build WeChat Mini Program
|
|
run: pnpm build:mp-weixin
|
|
|
|
- name: Build H5
|
|
run: pnpm build:h5
|
|
|
|
- name: Build iOS
|
|
run: pnpm build:app-ios
|
|
|
|
- name: Upload WeChat Mini Program artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wechat-miniprogram-build
|
|
path: dist/build/mp-weixin/
|
|
retention-days: 7
|
|
|
|
- name: Upload H5 artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: h5-build
|
|
path: dist/build/h5/
|
|
retention-days: 7
|
|
|
|
- name: Upload iOS artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ios-build
|
|
path: dist/build/app-ios/
|
|
retention-days: 7
|
|
|
|
- name: Build summary
|
|
run: |
|
|
echo "## Build and Test Summary" >> $GITHUB_STEP_SUMMARY
|
|
echo "### Development Mode Tests" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ WeChat Mini Program dev mode test completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ H5 dev mode test completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ iOS dev mode test completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "### Build Results" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ WeChat Mini Program build completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ H5 build completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ iOS build completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "📦 All artifacts uploaded successfully" >> $GITHUB_STEP_SUMMARY
|
|
- name: Build Docs (VitePress)
|
|
run: pnpm -C docs run docs:build
|
|
|
|
- name: Upload Docs artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: docs-build
|
|
path: docs/.vitepress/dist/
|
|
retention-days: 7
|