Skip to content

Commit e05ec5b

Browse files
committed
fix: Get windows flutter apps running properly.
Also test that this actually works.
1 parent a8f8221 commit e05ec5b

4 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ jobs:
88
common:
99
uses: ./.github/workflows/common-ci.yml
1010

11+
flutter:
12+
uses: ./.github/workflows/flutter.yml
13+
with:
14+
project-name: hello
15+
secrets:
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
17+
1118
mypy:
1219
runs-on: ubuntu-slim
1320
steps:

‎.github/workflows/flutter.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,18 @@ jobs:
365365
name: ${{ inputs.project-name }}-windows-x64.tar.gz
366366
- name: Extract artifact
367367
run: tar -zxf ${{ inputs.project-name }}-windows-x64.tar.gz
368+
# Started directly, the app keeps the step's output open, and the runner
369+
# kills it 5 seconds after the shell exits, before its window shows.
368370
- name: Run ${{ inputs.project-name }}
369-
run: ./${{ inputs.project-name }}.exe
371+
run: |
372+
$app = Start-Process ./${{ inputs.project-name }}.exe -PassThru -RedirectStandardOutput app.log -RedirectStandardError app-err.log
373+
for ($i = 0; $i -lt 120 -and $app.MainWindowHandle -eq 0 -and -not $app.HasExited; $i++) {
374+
Start-Sleep 1
375+
$app.Refresh()
376+
}
377+
Start-Sleep 5
378+
Get-Content app.log, app-err.log
379+
if ($app.HasExited) { exit 1 }
370380
- name: Download nircmd
371381
run: curl -L https://www.nirsoft.net/utils/nircmd-x64.zip -o nircmd-x64.zip && unzip nircmd-x64.zip
372382
- name: Take a screenshot

‎.restyled.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ restylers:
1919
image: ghcr.io/toktok/restyler-prettier:v3.9.10-6
2020
- prettier-yaml:
2121
image: ghcr.io/toktok/restyler-prettier:v3.9.10-6
22+
- shellcheck:
23+
image: ghcr.io/toktok/restyler-shellcheck:v0.11.0
2224
- shellharden:
2325
image: ghcr.io/toktok/restyler-shellharden:v4.3.2
2426
- shfmt:

‎tools/prepare‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
# flutter.yml runs this in every app; here it makes the app ci.yml tests it on.
3+
exec flutter create --project-name hello .

0 commit comments

Comments
 (0)