fix(ci): fix YAML syntax in matrix include blocks #63
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: Core Validation | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| # Pipeline 2 — Core Validation (target: < 5 min on PR) | |
| # | |
| # Two jobs, gated by a shared path-filter: | |
| # | |
| # test-pr — PR trigger only. | |
| # Single runner (ubuntu-22.04, pinned Flutter). | |
| # Only the packages that changed are tested, so a one-line | |
| # fix in hyper_render_html doesn't re-run core/markdown/etc. | |
| # | |
| # test-matrix — Push to main/develop only. | |
| # Full 3-OS × 2-channel matrix to catch platform regressions | |
| # before the tag lands. | |
| # | |
| # What this job does NOT do (handled by Pipeline 1 — analyze.yml): | |
| # • dart format | |
| # • flutter analyze | |
| # ───────────────────────────────────────────────────────────────────────────── | |
| env: | |
| FLUTTER_VERSION: "3.41.5" | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| jobs: | |
| # ── Changed-path detection ───────────────────────────────────────────────── | |
| path-filter: | |
| name: Detect Changed Packages | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| changed_core: ${{ steps.filter.outputs.core }} | |
| changed_html: ${{ steps.filter.outputs.html }} | |
| changed_markdown: ${{ steps.filter.outputs.markdown }} | |
| changed_highlight: ${{ steps.filter.outputs.highlight }} | |
| changed_clipboard: ${{ steps.filter.outputs.clipboard }} | |
| changed_devtools: ${{ steps.filter.outputs.devtools }} | |
| changed_root: ${{ steps.filter.outputs.root }} | |
| changed_any_dart: ${{ steps.filter.outputs.any_dart }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| core: | |
| - 'packages/hyper_render_core/**' | |
| html: | |
| - 'packages/hyper_render_html/**' | |
| markdown: | |
| - 'packages/hyper_render_markdown/**' | |
| highlight: | |
| - 'packages/hyper_render_highlight/**' | |
| clipboard: | |
| - 'packages/hyper_render_clipboard/**' | |
| devtools: | |
| - 'packages/hyper_render_devtools/**' | |
| root: | |
| - 'lib/**' | |
| - 'test/**' | |
| - 'pubspec.yaml' | |
| - 'pubspec.lock' | |
| any_dart: | |
| - '**/*.dart' | |
| - '**/pubspec.yaml' | |
| - '**/pubspec.lock' | |
| - '**/analysis_options.yaml' | |
| # ── PR: fast single-OS run — only changed packages ───────────────────────── | |
| test-pr: | |
| name: Tests (PR · ubuntu-22.04 · stable) | |
| runs-on: ubuntu-22.04 | |
| needs: path-filter | |
| if: >- | |
| github.event_name == 'pull_request' && | |
| needs.path-filter.outputs.changed_any_dart == 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| channel: stable | |
| cache: true | |
| - name: Restore pub cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| ${{ env.PUB_CACHE }} | |
| key: pub-ubuntu-${{ hashFiles('**/pubspec.lock') }} | |
| restore-keys: pub-ubuntu- | |
| - name: flutter pub get | |
| run: flutter pub get | |
| # Root package — always run when root lib/test or pubspec changed. | |
| # Also covers tests that exercise the core package from the root. | |
| - name: Test root package | |
| if: >- | |
| needs.path-filter.outputs.changed_root == 'true' || | |
| needs.path-filter.outputs.changed_core == 'true' | |
| run: flutter test --no-pub | |
| - name: Test hyper_render_core | |
| if: needs.path-filter.outputs.changed_core == 'true' | |
| working-directory: packages/hyper_render_core | |
| run: flutter test --no-pub | |
| - name: Test hyper_render_html | |
| if: >- | |
| needs.path-filter.outputs.changed_html == 'true' || | |
| needs.path-filter.outputs.changed_core == 'true' | |
| working-directory: packages/hyper_render_html | |
| run: flutter test --no-pub | |
| - name: Test hyper_render_markdown | |
| if: >- | |
| needs.path-filter.outputs.changed_markdown == 'true' || | |
| needs.path-filter.outputs.changed_core == 'true' | |
| working-directory: packages/hyper_render_markdown | |
| run: | | |
| if [ -d test ]; then flutter test --no-pub; else echo "No tests in this package — skipping."; fi | |
| - name: Test hyper_render_highlight | |
| if: >- | |
| needs.path-filter.outputs.changed_highlight == 'true' || | |
| needs.path-filter.outputs.changed_core == 'true' | |
| working-directory: packages/hyper_render_highlight | |
| run: | | |
| if [ -d test ]; then flutter test --no-pub; else echo "No tests in this package — skipping."; fi | |
| - name: Test hyper_render_clipboard | |
| if: >- | |
| needs.path-filter.outputs.changed_clipboard == 'true' || | |
| needs.path-filter.outputs.changed_core == 'true' | |
| working-directory: packages/hyper_render_clipboard | |
| run: | | |
| if [ -d test ]; then flutter test --no-pub; else echo "No tests in this package — skipping."; fi | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-pr-${{ github.run_number }} | |
| path: | | |
| test-results/ | |
| **/test-results/ | |
| retention-days: 7 | |
| # ── Push to main/develop: full 3-OS × 2-channel matrix ──────────────────── | |
| test-matrix: | |
| name: Tests (${{ matrix.os }} · ${{ matrix.flutter-channel }}) | |
| runs-on: ${{ matrix.os }} | |
| needs: path-filter | |
| if: >- | |
| github.event_name == 'push' && | |
| needs.path-filter.outputs.changed_any_dart == 'true' | |
| strategy: | |
| fail-fast: false # let all matrix legs complete so we see the full picture | |
| matrix: | |
| include: | |
| # Stable: all 3 OS — pinned Flutter version | |
| - { os: ubuntu-22.04, flutter-channel: stable, flutter-version: "3.41.5" } | |
| - { os: macos-latest, flutter-channel: stable, flutter-version: "3.41.5" } | |
| - { os: windows-latest, flutter-channel: stable, flutter-version: "3.41.5" } | |
| # Beta: ubuntu only, no version pin (use latest beta build) | |
| - { os: ubuntu-22.04, flutter-channel: beta, flutter-version: "" } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ matrix.flutter-version }} | |
| channel: ${{ matrix.flutter-channel }} | |
| cache: true | |
| - name: flutter pub get | |
| run: flutter pub get | |
| - name: Run all tests (exclude golden — pixel refs are ubuntu-22.04 only) | |
| # Golden tests are pinned to ubuntu-22.04 in golden.yml. | |
| # Running them on macOS/Windows would always fail due to font/subpixel differences. | |
| run: >- | |
| flutter test --no-pub | |
| test/accessibility_test.dart | |
| test/css_keyframes_test.dart | |
| test/fragment_test.dart | |
| test/giant_div_test.dart | |
| test/html_heuristics_test.dart | |
| test/html_sanitizer_test.dart | |
| test/hyper_render_test.dart | |
| test/hyper_render_widget_test.dart | |
| test/hyper_selection_overlay_test.dart | |
| test/hyper_viewer_animated_switcher_test.dart | |
| test/integration/ | |
| test/integration_test.dart | |
| test/integration_test_all.dart | |
| test/integration_test_extended.dart | |
| test/layout_logic_test.dart | |
| test/lru_cache_test.dart | |
| test/media_test.dart | |
| test/memory/ | |
| test/model/ | |
| test/render_hyper_box_test.dart | |
| test/reproduce_semantics_error_test.dart | |
| test/ruby_selection_test.dart | |
| test/security_edge_cases_test.dart | |
| test/style/ | |
| test/svg_builder_test.dart | |
| test/system_test.dart | |
| test/table_layout_test.dart | |
| test/v120/ | |
| test/widget/ | |
| - name: Upload test results | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.os }}-${{ matrix.flutter-channel }}-${{ github.run_number }} | |
| path: | | |
| test-results/ | |
| **/test-results/ | |
| retention-days: 7 |