| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- 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
|