|
40 | 40 | changed_highlight: ${{ steps.filter.outputs.highlight }} |
41 | 41 | changed_clipboard: ${{ steps.filter.outputs.clipboard }} |
42 | 42 | changed_devtools: ${{ steps.filter.outputs.devtools }} |
| 43 | + changed_math: ${{ steps.filter.outputs.math }} |
| 44 | + changed_epub: ${{ steps.filter.outputs.epub }} |
43 | 45 | changed_root: ${{ steps.filter.outputs.root }} |
44 | 46 | changed_any_dart: ${{ steps.filter.outputs.any_dart }} |
45 | 47 | steps: |
|
60 | 62 | - 'packages/hyper_render_clipboard/**' |
61 | 63 | devtools: |
62 | 64 | - 'packages/hyper_render_devtools/**' |
| 65 | + math: |
| 66 | + - 'packages/hyper_render_math/**' |
| 67 | + epub: |
| 68 | + - 'packages/hyper_render_epub/**' |
63 | 69 | root: |
64 | 70 | - 'lib/**' |
65 | 71 | - 'test/**' |
@@ -99,45 +105,12 @@ jobs: |
99 | 105 | working-directory: example/android |
100 | 106 | run: ./gradlew assembleDebug |
101 | 107 |
|
102 | | - emulator-tests: |
103 | | - name: Integration Tests (Emulator) |
104 | | - runs-on: macos-latest |
105 | | - needs: path-filter |
106 | | - if: >- |
107 | | - github.event_name == 'pull_request' && |
108 | | - needs.path-filter.outputs.changed_any_dart == 'true' |
109 | | - strategy: |
110 | | - fail-fast: false |
111 | | - matrix: |
112 | | - platform: [android, ios] |
113 | | - steps: |
114 | | - - uses: actions/checkout@v4 |
115 | | - - name: Setup Java |
116 | | - if: matrix.platform == 'android' |
117 | | - uses: actions/setup-java@v3 |
118 | | - with: |
119 | | - distribution: 'zulu' |
120 | | - java-version: '17' |
121 | | - - name: Setup Flutter |
122 | | - uses: subosito/flutter-action@v2 |
123 | | - with: |
124 | | - flutter-version: ${{ env.FLUTTER_VERSION }} |
125 | | - channel: stable |
126 | | - cache: true |
127 | | - - name: flutter pub get |
128 | | - run: flutter pub get |
129 | | - - name: Run Android Emulator Tests |
130 | | - if: matrix.platform == 'android' |
131 | | - uses: reactivecircus/android-emulator-runner@v2 |
132 | | - with: |
133 | | - api-level: 29 |
134 | | - arch: arm64-v8a |
135 | | - script: flutter test test/integration/ |
136 | | - - name: Run iOS Simulator Tests |
137 | | - if: matrix.platform == 'ios' |
138 | | - run: | |
139 | | - xcrun simctl list devicetypes |
140 | | - flutter test test/integration/ -d "iPhone 15" || flutter test test/integration/ |
| 108 | + # NOTE: the former "Integration Tests (Emulator)" job was removed. It ran |
| 109 | + # `flutter test test/integration/` with no device target, i.e. on the host VM |
| 110 | + # — the same tests test-pr runs below — but on macOS runners (10x the |
| 111 | + # per-minute price), and its Android leg could not boot an x86 emulator on |
| 112 | + # Apple Silicon (HVF_UNSUPPORTED). Real on-device coverage lives in |
| 113 | + # example/integration_test/all_demos_test.dart (run locally with -d macos). |
141 | 114 |
|
142 | 115 | test-pr: |
143 | 116 | name: Tests (PR · ubuntu-22.04 · stable) |
@@ -190,31 +163,60 @@ jobs: |
190 | 163 | needs.path-filter.outputs.changed_html == 'true' || |
191 | 164 | needs.path-filter.outputs.changed_core == 'true' |
192 | 165 | working-directory: packages/hyper_render_html |
193 | | - run: flutter test --no-pub |
| 166 | + run: flutter pub get && flutter test --no-pub |
194 | 167 |
|
195 | 168 | - name: Test hyper_render_markdown |
196 | 169 | if: >- |
197 | 170 | needs.path-filter.outputs.changed_markdown == 'true' || |
198 | 171 | needs.path-filter.outputs.changed_core == 'true' |
199 | 172 | working-directory: packages/hyper_render_markdown |
200 | 173 | run: | |
201 | | - if [ -d test ]; then flutter test --no-pub; else echo "No tests in this package — skipping."; fi |
| 174 | + if [ -d test ]; then flutter pub get && flutter test --no-pub; else echo "No tests in this package — skipping."; fi |
202 | 175 |
|
203 | 176 | - name: Test hyper_render_highlight |
204 | 177 | if: >- |
205 | 178 | needs.path-filter.outputs.changed_highlight == 'true' || |
206 | 179 | needs.path-filter.outputs.changed_core == 'true' |
207 | 180 | working-directory: packages/hyper_render_highlight |
208 | 181 | run: | |
209 | | - if [ -d test ]; then flutter test --no-pub; else echo "No tests in this package — skipping."; fi |
| 182 | + if [ -d test ]; then flutter pub get && flutter test --no-pub; else echo "No tests in this package — skipping."; fi |
210 | 183 |
|
211 | 184 | - name: Test hyper_render_clipboard |
212 | 185 | if: >- |
213 | 186 | needs.path-filter.outputs.changed_clipboard == 'true' || |
214 | 187 | needs.path-filter.outputs.changed_core == 'true' |
215 | 188 | working-directory: packages/hyper_render_clipboard |
216 | 189 | run: | |
217 | | - if [ -d test ]; then flutter test --no-pub; else echo "No tests in this package — skipping."; fi |
| 190 | + if [ -d test ]; then flutter pub get && flutter test --no-pub; else echo "No tests in this package — skipping."; fi |
| 191 | +
|
| 192 | + - name: Test hyper_render_math |
| 193 | + if: >- |
| 194 | + needs.path-filter.outputs.changed_math == 'true' || |
| 195 | + needs.path-filter.outputs.changed_core == 'true' |
| 196 | + working-directory: packages/hyper_render_math |
| 197 | + run: flutter pub get && flutter test --no-pub |
| 198 | + |
| 199 | + - name: Test hyper_render_epub |
| 200 | + if: >- |
| 201 | + needs.path-filter.outputs.changed_epub == 'true' || |
| 202 | + needs.path-filter.outputs.changed_root == 'true' || |
| 203 | + needs.path-filter.outputs.changed_core == 'true' |
| 204 | + working-directory: packages/hyper_render_epub |
| 205 | + run: flutter pub get && flutter test --no-pub |
| 206 | + |
| 207 | + - name: Test hyper_render_devtools |
| 208 | + if: >- |
| 209 | + needs.path-filter.outputs.changed_devtools == 'true' || |
| 210 | + needs.path-filter.outputs.changed_core == 'true' |
| 211 | + working-directory: packages/hyper_render_devtools |
| 212 | + run: flutter pub get && flutter test --no-pub |
| 213 | + |
| 214 | + # The panel imports dart:js_interop: its widget test only compiles for |
| 215 | + # the web (@TestOn('browser')). ubuntu runners ship Chrome. |
| 216 | + - name: Test hyper_render_devtools panel (Chrome) |
| 217 | + if: needs.path-filter.outputs.changed_devtools == 'true' |
| 218 | + working-directory: packages/hyper_render_devtools/devtools_ui |
| 219 | + run: flutter pub get && flutter test --no-pub --platform chrome |
218 | 220 |
|
219 | 221 | - name: Upload test results |
220 | 222 | if: failure() |
|
0 commit comments