1+ name :Tests
2+
3+ on :
4+ push :
5+ branches :[ develop, main ]
6+ pull_request :
7+ branches :[ develop, main ]
8+
9+ concurrency :
10+ group :integration-tests-${{ github.ref }}
11+ cancel-in-progress :true
12+
13+ jobs :
14+ tests :
15+ name :Integration Tests (${{ matrix.os }})
16+ runs-on :${{ matrix.os }}
17+ strategy :
18+ fail-fast :false
19+ matrix :
20+ include :
21+ -os :ubuntu-24.04
22+ rid :linux-x64
23+ -os :windows-2022
24+ rid :win-x64
25+ -os :macos-14
26+ rid :osx-arm64
27+
28+ env :
29+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE :1
30+ DOTNET_NOLOGO :1
31+ CI :true
32+ ELECTRON_ENABLE_LOGGING :1
33+
34+ steps :
35+ -name :Checkout
36+ uses :actions/checkout@v4
37+
38+ -name :Setup .NET
39+ uses :actions/setup-dotnet@v4
40+ with :
41+ dotnet-version :' 10.0.x'
42+
43+ -name :Setup Node.js
44+ uses :actions/setup-node@v4
45+ with :
46+ node-version :' 22'
47+
48+ -name :Restore
49+ run :dotnet restore -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
50+
51+ -name :Build
52+ run :dotnet build --no-restore -c Release -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
53+
54+ -name :Install Linux GUI dependencies
55+ if :runner.os == 'Linux'
56+ run :|
57+ set -e
58+ sudo apt-get update
59+ # Core Electron dependencies
60+ sudo apt-get install -y xvfb \
61+ libgtk-3-0 libnss3 libgdk-pixbuf-2.0-0 libdrm2 libgbm1 libxss1 libxtst6 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libx11-xcb1 libasound2t64
62+
63+ -name :Run tests (Linux)
64+ if :runner.os == 'Linux'
65+ continue-on-error :true
66+ run :|
67+ mkdir -p test-results/Ubuntu
68+ xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
69+ -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} \
70+ --logger "trx;LogFileName=Ubuntu.trx" \
71+ --logger "console;verbosity=detailed" \
72+ --results-directory test-results
73+
74+ -name :Run tests (Windows)
75+ if :runner.os == 'Windows'
76+ continue-on-error :true
77+ run :|
78+ New-Item -ItemType Directory -Force -Path test-results/Windows | Out-Null
79+ dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} --logger "trx;LogFileName=Windows.trx" --logger "console;verbosity=detailed" --results-directory test-results
80+
81+ -name :Run tests (macOS)
82+ if :runner.os == 'macOS'
83+ continue-on-error :true
84+ run :|
85+ mkdir -p test-results/macOS
86+ dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} --logger "trx;LogFileName=macOS.trx" --logger "console;verbosity=detailed" --results-directory test-results
87+
88+ -name :Upload raw test results
89+ if :always()
90+ uses :actions/upload-artifact@v4
91+ with :
92+ name :test-results-${{ matrix.os }}
93+ path :test-results/*.trx
94+ retention-days :7
95+
96+ summary :
97+ name :Test Results
98+ runs-on :ubuntu-24.04
99+ if :always()
100+ needs :[tests]
101+
102+ permissions :
103+ actions :read
104+ contents :read
105+ checks :write
106+ pull-requests :write
107+
108+ steps :
109+ -name :Download all test results
110+ uses :actions/download-artifact@v4
111+ with :
112+ path :test-results
113+
114+ -name :Setup .NET (for CTRF conversion)
115+ uses :actions/setup-dotnet@v4
116+ with :
117+ dotnet-version :' 10.0.x'
118+
119+ -name :Install CTRF TRX→CTRF converter (dotnet tool)
120+ run :|
121+ dotnet new tool-manifest
122+ dotnet tool install DotnetCtrfJsonReporter --local
123+
124+ -name :Convert TRX → CTRF and clean names (keep suites; set filePath=OS)
125+ shell :bash
126+ run :|
127+ set -euo pipefail
128+ mkdir -p ctrf
129+ shopt -s globstar nullglob
130+ conv=0
131+ for trx in test-results/**/*.trx; do
132+ fname="$(basename "$trx")"
133+ os="${fname%.trx}"
134+ outdir="ctrf/${os}"
135+ mkdir -p "$outdir"
136+ out="${outdir}/ctrf-report.json"
137+
138+ dotnet tool run DotnetCtrfJsonReporter -p "$trx" -d "$outdir" -f "ctrf-report.json"
139+
140+ jq --arg os "$os" '.results.tests |= map(.filePath = $os)' "$out" > "${out}.tmp" && mv "${out}.tmp" "$out"
141+
142+ echo "Converted & normalized $trx -> $out"
143+ conv=$((conv+1))
144+ done
145+ echo "Processed $conv TRX file(s)"
146+
147+
148+ -name :Publish Test Report
149+ if :always()
150+ uses :ctrf-io/github-test-reporter@v1
151+ with :
152+ report-path :' ctrf/**/*.json'
153+
154+ summary :true
155+ pull-request :false
156+ status-check :false
157+ status-check-name :' Integration Tests'
158+ use-suite-name :true
159+ update-comment :true
160+ always-group-by :true
161+ overwrite-comment :true
162+ exit-on-fail :true
163+ group-by :' suite'
164+ upload-artifact :true
165+ fetch-previous-results :true
166+
167+ summary-report :false
168+ summary-delta-report :true
169+ github-report :true
170+ test-report :false
171+ test-list-report :false
172+ failed-report :true
173+ failed-folded-report :false
174+ skipped-report :true
175+ suite-folded-report :true
176+ suite-list-report :false
177+ file-report :true
178+ previous-results-report :true
179+ insights-report :true
180+ flaky-report :true
181+ flaky-rate-report :true
182+ fail-rate-report :false
183+ slowest-report :false
184+
185+ report-order :' summary-delta-report,failed-report,skipped-report,suite-folded-report,file-report,previous-results-report,github-report'
186+ env :
187+ GITHUB_TOKEN :${{ github.token }}
188+
189+
190+ -name :Create PR Comment
191+ if :always()
192+ uses :ctrf-io/github-test-reporter@v1
193+ with :
194+ report-path :' ctrf/**/*.json'
195+
196+ summary :true
197+ pull-request :true
198+ use-suite-name :true
199+ update-comment :true
200+ always-group-by :true
201+ overwrite-comment :true
202+ upload-artifact :false
203+
204+ pull-request-report :true
205+ env :
206+ GITHUB_TOKEN :${{ github.token }}
207+
208+ -name :Summary
209+ run :echo "All matrix test jobs completed."