|
1 | 1 | name: Flex CI |
2 | 2 | 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 |
13 | 12 |
|
14 | 13 | 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 |
17 | 16 |
|
18 | 17 | 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