Repository navigation
98 lines (98 loc) · 4.2 KB
/
Copy pathbuild.yml
File metadata and controls
98 lines (98 loc) · 4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Native builds
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build and test SwiftUI app
run: xcodebuild -project WriteBench.xcodeproj -scheme WriteBench -configuration Debug -derivedDataPath build -destination 'platform=macOS' CODE_SIGN_IDENTITY=- test
ipad:
runs-on: macos-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Select an available iPad simulator
run: |
xcrun simctl list devices available -j > /tmp/simulators.json
python3 - <<'PY' >> "$GITHUB_ENV"
import json
devices = json.load(open('/tmp/simulators.json'))['devices']
ipad = next(d for group in devices.values() for d in group if d['name'].startswith('iPad'))
print('IPAD_SIMULATOR=' + ipad['udid'])
PY
- name: Boot iPad simulator
run: |
xcrun simctl boot "$IPAD_SIMULATOR"
xcrun simctl bootstatus "$IPAD_SIMULATOR" -b
- name: Build and test native iPad app
run: xcodebuild -project WriteBench.xcodeproj -scheme WriteBenchPad -destination "platform=iOS Simulator,id=$IPAD_SIMULATOR" -parallel-testing-enabled NO -derivedDataPath build-ipad CODE_SIGN_IDENTITY=- test
- name: Upload iPad test evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: ipad-verification
path: build-ipad/Logs/Test/*.xcresult
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Publish WPF app
run: dotnet publish platforms/windows/WriteBench/WriteBench.csproj -c Release -r win-x64 --self-contained true -o publish
- name: Validate domain, credentials, native WPF interactions and real OCR
shell: pwsh
run: |
Copy-Item Documentation/TestImages/ocr-sample-1.png publish/ocr-fixture.png
$result = Start-Process "$pwd/publish/WriteBench.exe" -ArgumentList '--self-test' -PassThru
if (-not $result.WaitForExit(180000)) { Stop-Process -Id $result.Id -Force; throw 'Self-test timed out' }
if ($result.ExitCode -ne 0) { Get-Content publish/self-test-error.txt; exit 1 }
Get-Content publish/self-test-passed.txt
- name: Render actual WPF screens
shell: pwsh
run: |
$result = Start-Process "$pwd/publish/WriteBench.exe" -ArgumentList '--render-preview' -PassThru
if (-not $result.WaitForExit(60000)) { Stop-Process -Id $result.Id -Force; throw 'Preview timed out' }
if ($result.ExitCode -ne 0) { Get-Content publish/preview-error.txt; exit 1 }
- name: Upload Windows verification evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: windows-verification
path: |
publish/*test*.txt
publish/*error*.txt
publish/windows-preview-*.png
- name: Package self-contained Windows x64 app
shell: pwsh
run: |
Remove-Item publish/ocr-fixture.png, publish/*test*.txt, publish/windows-preview-*.png -ErrorAction SilentlyContinue
Copy-Item platforms/windows/README.md publish/README.md
Copy-Item THIRD_PARTY_NOTICES.md publish/THIRD_PARTY_NOTICES.md
Compress-Archive -Path publish/* -DestinationPath WriteBench-Windows-x64.zip
(Get-FileHash WriteBench-Windows-x64.zip -Algorithm SHA256).Hash.ToLower() + ' WriteBench-Windows-x64.zip' | Set-Content WriteBench-Windows-x64.zip.sha256
- uses: actions/upload-artifact@v4
with:
name: WriteBench-Windows-x64
path: |
WriteBench-Windows-x64.zip
WriteBench-Windows-x64.zip.sha256
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Build APK and run unit tests
working-directory: platforms/android
run: ./gradlew :app:testDebugUnitTest :app:assembleDebug --no-daemon