stages: - verify - build default: interruptible: true retry: max: 1 when: - runner_system_failure - stuck_or_timeout_failure workflow: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_TAG backend-test: stage: verify image: eclipse-temurin:21-jdk variables: GRADLE_USER_HOME: $CI_PROJECT_DIR/.cache/gradle cache: key: files: - backend/gradle/wrapper/gradle-wrapper.properties paths: - .cache/gradle/caches/ - .cache/gradle/wrapper/ before_script: - cd backend - chmod +x gradlew script: - ./gradlew --no-daemon test artifacts: when: always expire_in: 7 days reports: junit: backend/boot/build/test-results/test/*.xml ai-service-test: stage: verify image: python:3.12-slim variables: PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip QWEN_API_KEY: "" cache: key: files: - ai-service/pyproject.toml paths: - .cache/pip/ before_script: - cd ai-service - python -m pip install --upgrade pip - python -m pip install -e '.[dev]' script: - python -m compileall -q app tests - mkdir -p reports - pytest --junitxml=reports/pytest.xml artifacts: when: always expire_in: 7 days reports: junit: ai-service/reports/pytest.xml flutter-verify: stage: verify image: ghcr.io/cirruslabs/flutter:stable variables: PUB_CACHE: $CI_PROJECT_DIR/.cache/pub cache: key: files: - mobile/pubspec.lock paths: - .cache/pub/ before_script: - cd mobile - flutter pub get script: - dart format --output=none --set-exit-if-changed lib test - flutter analyze - mkdir -p reports - flutter test --machine > reports/flutter-test.json after_script: - test -f mobile/reports/flutter-test.json || true artifacts: when: always expire_in: 7 days paths: - mobile/reports/flutter-test.json admin-web-verify: stage: verify image: node:24-alpine cache: key: files: - admin-web/package-lock.json paths: - .cache/npm/ before_script: - cd admin-web - npm ci --cache ../.cache/npm script: - npm test - npm run build artifacts: expire_in: 7 days paths: - admin-web/dist/ android-debug-build: stage: build image: ghcr.io/cirruslabs/flutter:stable needs: - flutter-verify variables: PUB_CACHE: $CI_PROJECT_DIR/.cache/pub cache: key: files: - mobile/pubspec.lock paths: - .cache/pub/ - mobile/.gradle/ before_script: - cd mobile - flutter pub get script: - flutter build apk --debug artifacts: expire_in: 7 days paths: - mobile/build/app/outputs/flutter-apk/app-debug.apk # iOS 构建需要项目自行配置带 Xcode 和 Flutter 的 macOS GitLab Runner。 # 配置后可复制 flutter-verify 作业,并使用 tags: [macos] 及: # flutter build ios --simulator --no-codesign