name: Main Merge on: push: branches: [main] jobs: backend: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 with: workspaces: crates → target - name: cargo fmt run: cargo fmt --all -- --check - name: cargo check run: cargo check --all-targets - name: cargo clippy run: cargo clippy --all-targets -- -D warnings - name: cargo test run: cargo test --all - name: cargo audit # 安全审计(可选,允许失败) run: | cargo install cargo-audit 2>/dev/null || true cargo audit || true frontend: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: subosito/flutter-action@v2 with: flutter-version: '3.x' channel: 'stable' - name: Install dependencies run: flutter pub get working-directory: app - name: flutter analyze run: flutter analyze --no-fatal-infos working-directory: app - name: flutter test run: flutter test working-directory: app