fix(ci): stabilize Android overlay instrumentation #353
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| env: | |
| FLUTTER_VERSION: "3.41.5" | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Generate code | |
| run: dart run build_runner build --delete-conflicting-outputs | |
| - name: Verify generated code is committed | |
| run: | | |
| if git status --porcelain | grep -E '\.g\.dart$' >/dev/null; then | |
| echo "::error::Generated files changed. Commit the generated output." | |
| git status --porcelain | |
| exit 1 | |
| fi | |
| - name: Analyze (phased gate) | |
| run: flutter analyze --no-fatal-infos --no-fatal-warnings 2>&1 | tee /tmp/flutter_analyze.log | |
| - name: Enforce analyze issue budget | |
| run: bash tool/ci/check_analyze_budget.sh /tmp/flutter_analyze.log 334 | |
| - name: Upload analyze report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: analyze-log | |
| path: /tmp/flutter_analyze.log | |
| test_shards: | |
| # Keep PR/branch feedback fast; main/tag pushes run the coverage job instead. | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/v')) | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard_index: [0, 1, 2, 3] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Generate code | |
| run: dart run build_runner build --delete-conflicting-outputs | |
| - name: Test shard | |
| run: flutter test --no-pub -j 8 --total-shards 4 --shard-index ${{ matrix.shard_index }} | |
| windows_build: | |
| needs: quality | |
| runs-on: windows-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build Windows debug app | |
| run: flutter build windows --debug | |
| coverage: | |
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 35 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| cache: true | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Generate code | |
| run: dart run build_runner build --delete-conflicting-outputs | |
| - name: Test (full) with coverage | |
| run: flutter test --no-pub --coverage -j 8 | |
| - name: Install lcov | |
| run: | | |
| if ! command -v lcov >/dev/null 2>&1; then | |
| sudo apt-get update | |
| sudo apt-get install -y lcov | |
| fi | |
| - name: Enforce coverage threshold | |
| run: bash tool/ci/check_coverage.sh coverage/lcov.info 35 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage/lcov.filtered.info | |
| fail_ci_if_error: false | |
| - name: Upload coverage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-lcov | |
| path: | | |
| coverage/lcov.info | |
| coverage/lcov.filtered.info |