Skip to content

Commit bc18eb3

Browse files
Fixup github actions (#685)
* Revert the github actions corrupted in the Modernization * Update CI with current build steps (LT-22420) * Pull out native CI to it's own piece Co-authored-by: John Lambert <john_lambert@sil.org>
1 parent 8e28903 commit bc18eb3

File tree

12 files changed

+1155
-950
lines changed

12 files changed

+1155
-950
lines changed

.github/instructions/terminal.instructions.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ description: "Terminal command patterns for auto-approval in FieldWorks"
66

77
# Terminal Commands
88

9-
Commands with pipes (`|`), `&&`, or `2>&1` require manual approval. Use `scripts/Agent/` wrappers instead.
9+
Commands with pipes (`|`), `&&`, or `2>&1` require manual approval. Use repository wrapper scripts instead.
10+
11+
Placement policy for wrappers:
12+
- Prefer `Build/Agent/` for new build/test/CI orchestration scripts.
1013

1114
**MCP-first:** When the `ps-tools` MCP server is running, prefer MCP tools (`Git-Search`, `Read-FileContent`, `Invoke-AgentTask`, `build`, `test`, agent tools) instead of direct terminal commands. Use wrappers only when MCP is unavailable.
1215

.github/workflows/CI-native.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Flex CI Native
2+
on:
3+
push:
4+
branches: ["release/**", "main", "feature/PubSub"]
5+
paths:
6+
- 'Src/**/*.cpp'
7+
- 'Src/**/*.h'
8+
- 'Src/**/*.hpp'
9+
- 'Src/**/*.cc'
10+
- 'Src/**/*.ixx'
11+
- 'Src/**/*.def'
12+
- 'Src/**/*.vcxproj'
13+
- 'Src/**/*.vcxproj.filters'
14+
- 'Src/**/*.mak'
15+
- 'Lib/**/*.cpp'
16+
- 'Lib/**/*.h'
17+
- 'Lib/**/*.hpp'
18+
- 'Lib/**/*.cc'
19+
- 'Lib/**/*.ixx'
20+
- 'Lib/**/*.def'
21+
- 'Build/Src/NativeBuild/**'
22+
- 'Build/scripts/Invoke-CppTest.ps1'
23+
- 'test.ps1'
24+
pull_request:
25+
branches: ["release/**", "main", "feature/PubSub"]
26+
paths:
27+
- 'Src/**/*.cpp'
28+
- 'Src/**/*.h'
29+
- 'Src/**/*.hpp'
30+
- 'Src/**/*.cc'
31+
- 'Src/**/*.ixx'
32+
- 'Src/**/*.def'
33+
- 'Src/**/*.vcxproj'
34+
- 'Src/**/*.vcxproj.filters'
35+
- 'Src/**/*.mak'
36+
- 'Lib/**/*.cpp'
37+
- 'Lib/**/*.h'
38+
- 'Lib/**/*.hpp'
39+
- 'Lib/**/*.cc'
40+
- 'Lib/**/*.ixx'
41+
- 'Lib/**/*.def'
42+
- 'Build/Src/NativeBuild/**'
43+
- 'Build/scripts/Invoke-CppTest.ps1'
44+
- 'test.ps1'
45+
workflow_dispatch:
46+
47+
permissions:
48+
contents: read
49+
checks: write
50+
51+
concurrency:
52+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
53+
cancel-in-progress: true
54+
55+
jobs:
56+
native_build_and_test:
57+
name: Build Debug and run native tests
58+
runs-on: windows-latest
59+
steps:
60+
- name: Checkout Files
61+
uses: actions/checkout@v4
62+
id: checkout
63+
64+
- name: Build and run native tests
65+
id: native_test
66+
shell: powershell
67+
run: |
68+
.\test.ps1 -Configuration Debug -Native
69+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
70+
71+
- name: Summarize native test results
72+
if: ${{ always() }}
73+
shell: powershell
74+
run: |
75+
.\Build\Agent\Summarize-NativeTestResults.ps1 -Configuration Debug
76+
77+
- uses: actions/upload-artifact@v4
78+
if: ${{ !cancelled() && failure() }}
79+
with:
80+
name: native-build-logs
81+
path: |
82+
./*.log
83+
./Output/**/*.log

.github/workflows/CI.yml

Lines changed: 75 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,160 +1,81 @@
11
name: Flex CI
22
on:
3-
push:
4-
branches: ["release/**", "main", "feature/PubSub"]
5-
pull_request:
6-
branches: ["release/**", "main", "feature/PubSub"]
7-
workflow_dispatch:
8-
inputs:
9-
run_wix6_installer_build:
10-
description: "Run WiX 6 installer build (opt-in)"
11-
required: false
12-
default: "false"
3+
push:
4+
branches: ["release/**", "main", "feature/PubSub"]
5+
pull_request:
6+
branches: ["release/**", "main", "feature/PubSub"]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
checks: write
1312

1413
concurrency:
15-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16-
cancel-in-progress: true
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
1716

1817
jobs:
19-
debug_build_and_test:
20-
env:
21-
CROWDIN_API_KEY: ${{ secrets.FLEX_CROWDIN_API }}
22-
name: Build Debug and run Tests (x64 only)
23-
runs-on: windows-latest
24-
steps:
25-
- name: Checkout Files
26-
uses: actions/checkout@v4
27-
id: checkout
28-
29-
- name: Download 481 targeting pack
30-
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
31-
id: downloadfile # Remember to give an ID if you need the output filename
32-
with:
33-
url: "https://download.microsoft.com/download/8/1/8/81877d8b-a9b2-4153-9ad2-63a6441d11dd/NDP481-DevPack-ENU.exe"
34-
target: public/
35-
36-
- name: Install targeting pack
37-
shell: cmd
38-
working-directory: public
39-
run: NDP481-DevPack-ENU.exe /q
40-
41-
- name: Setup dotnet
42-
uses: actions/setup-dotnet@v4
43-
with:
44-
dotnet-version: |
45-
2.1.x
46-
3.1.x
47-
5.0.x
48-
49-
- name: Add NETFX tools to PATH
50-
shell: powershell
51-
run: |
52-
'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
53-
- name: Setup MSBuild
54-
uses: microsoft/setup-msbuild@v2
55-
- name: Build Debug and run tests
56-
id: build_and_test
57-
shell: powershell
58-
run: |
59-
$ErrorActionPreference = 'Stop'
60-
./build.ps1 -Configuration Debug -Platform x64 -MsBuildArgs @('/m', '/p:action=test', '/p:desktopNotAvailable=true') -LogFile Build/build.log
61-
62-
- name: Scan Debug Build Output
63-
shell: powershell
64-
working-directory: Build
65-
run: |
66-
$results = Select-String -Path "build.log" -Pattern "^\s*[1-9][0-9]* Error\(s\)"
67-
if ($results) {
68-
foreach ($result in $results) {
69-
Write-Host "Found errors in build.log $($result.LineNumber): $($result.Line)" -ForegroundColor red
70-
}
71-
exit 1
72-
} else {
73-
Write-Host "No errors found" -ForegroundColor green
74-
exit 0
75-
}
76-
77-
- name: Capture Test Results
78-
shell: powershell
79-
working-directory: Build
80-
run: .\NUnitReport /a ^| tee-object -FilePath test-results.log
81-
82-
- name: Report Test Results
83-
uses: sillsdev/fw-nunitreport-action@v2.0.0
84-
with:
85-
log-path: Build/test-results.log
86-
token: ${{ secrets.GITHUB_TOKEN }}
87-
88-
# Upload build and test artifacts
89-
- uses: actions/upload-artifact@v4
90-
with:
91-
name: build-logs
92-
path: Build/*.log
93-
94-
# Upload generated manifests for inspection (registration-free COM)
95-
- uses: actions/upload-artifact@v4
96-
with:
97-
name: regfree-manifests
98-
path: |
99-
Output/Debug/FieldWorks.exe.manifest
100-
if-no-files-found: warn
101-
102-
# Smoke test: Verify registration-free COM activation (no registry writes)
103-
- name: Smoke test - Reg-free COM activation
104-
shell: powershell
105-
run: |
106-
Write-Host "Testing registration-free COM activation..." -ForegroundColor Cyan
107-
$exitCode = & "Output\Debug\ComManifestTestHost.exe"
108-
if ($LASTEXITCODE -ne 0) {
109-
Write-Host "❌ COM activation test failed with exit code $LASTEXITCODE" -ForegroundColor Red
110-
exit $LASTEXITCODE
111-
} else {
112-
Write-Host "✅ COM activation test passed" -ForegroundColor Green
113-
}
114-
115-
wix6_installer_build:
116-
if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_wix6_installer_build == 'true'
117-
name: Build WiX 6 installer (opt-in)
118-
runs-on: windows-latest
119-
steps:
120-
- name: Checkout Files
121-
uses: actions/checkout@v4
122-
123-
- name: Download 481 targeting pack
124-
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
125-
id: downloadfile
126-
with:
127-
url: "https://download.microsoft.com/download/8/1/8/81877d8b-a9b2-4153-9ad2-63a6441d11dd/NDP481-DevPack-ENU.exe"
128-
target: public/
129-
130-
- name: Install targeting pack
131-
shell: cmd
132-
working-directory: public
133-
run: NDP481-DevPack-ENU.exe /q
134-
135-
- name: Setup dotnet
136-
uses: actions/setup-dotnet@v4
137-
with:
138-
dotnet-version: |
139-
2.1.x
140-
3.1.x
141-
5.0.x
142-
143-
- name: Add NETFX tools to PATH
144-
shell: powershell
145-
run: |
146-
'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8.1 Tools' | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
147-
148-
- name: Setup MSBuild
149-
uses: microsoft/setup-msbuild@v2
150-
151-
- name: Build WiX 6 installer
152-
shell: powershell
153-
run: |
154-
$ErrorActionPreference = 'Stop'
155-
./build.ps1 -BuildInstaller -InstallerToolset Wix6 -Configuration Debug -Platform x64 -LogFile Build/wix6-installer.log
156-
157-
- uses: actions/upload-artifact@v4
158-
with:
159-
name: wix6-installer-logs
160-
path: Build/wix6-installer.log
18+
debug_build_and_test:
19+
name: Build Debug and run managed tests
20+
runs-on: windows-latest
21+
steps:
22+
- name: Checkout Files
23+
uses: actions/checkout@v4
24+
id: checkout
25+
26+
- name: Build managed (with tests)
27+
id: managed_build
28+
shell: powershell
29+
run: |
30+
.\build.ps1 -Configuration Debug -Platform x64 -BuildTests
31+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
32+
33+
- name: Run managed tests
34+
id: managed_test
35+
shell: powershell
36+
run: |
37+
.\test.ps1 -Configuration Debug -NoBuild -TestFilter 'TestCategory!=LongRunning&TestCategory!=ByHand&TestCategory!=SmokeTest&TestCategory!=DesktopRequired'
38+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
39+
40+
- name: Upload TRX test results
41+
if: ${{ !cancelled() }}
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: trx-results
45+
path: |
46+
**/*.trx
47+
if-no-files-found: warn
48+
49+
- uses: actions/upload-artifact@v4
50+
if: ${{ !cancelled() && failure() }}
51+
with:
52+
name: build-logs
53+
path: |
54+
./*.log
55+
./Output/**/*.log
56+
57+
publish_test_results:
58+
name: Publish Test Results
59+
if: ${{ !cancelled() }}
60+
needs: debug_build_and_test
61+
runs-on: ubuntu-latest
62+
permissions:
63+
contents: read
64+
issues: read
65+
checks: write
66+
pull-requests: write
67+
steps:
68+
- name: Download TRX artifacts
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: trx-results
72+
path: test-results
73+
74+
- name: Publish Test Results
75+
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f
76+
with:
77+
files: 'test-results/**/*.trx'
78+
check_name: NUnit Tests
79+
comment_mode: always
80+
job_summary: true
81+
fail_on: test failures

0 commit comments

Comments
 (0)