Skip to content

Commit 5434b0e

Browse files
authored
Merge pull request #936 from ElectronNET/develop
Release 0.2.0
2 parents 5b0ab76 + 20acd31 commit 5434b0e

File tree

166 files changed

+3129
-2058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+3129
-2058
lines changed
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
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."
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Trailing Whitespace Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
check-trailing-whitespace:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Check for trailing whitespace
20+
run: |
21+
echo "Checking for trailing whitespace in changed files..."
22+
23+
# Get the base branch
24+
BASE_SHA="${{ github.event.pull_request.base.sha }}"
25+
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
26+
27+
# Get list of changed files (excluding deleted files)
28+
CHANGED_FILES=$(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA")
29+
30+
if [ -z "$CHANGED_FILES" ]; then
31+
echo "No files to check."
32+
exit 0
33+
fi
34+
35+
# File patterns to check (text files)
36+
PATTERNS="\.cs$|\.csproj$|\.sln$|\.ts$|\.html$|\.css$|\.scss$"
37+
38+
# Directories and file patterns to exclude
39+
EXCLUDE_PATTERNS="(^|\/)(\.|node_modules|bin|obj|artifacts|packages|\.vs|\.nuke\/temp)($|\/)"
40+
41+
ERRORS_FOUND=0
42+
TEMP_FILE=$(mktemp)
43+
44+
while IFS= read -r file; do
45+
# Skip if file doesn't exist (shouldn't happen with --diff-filter=d, but just in case)
46+
if [ ! -f "$file" ]; then
47+
continue
48+
fi
49+
50+
# Check if file matches patterns to check
51+
if ! echo "$file" | grep -qE "$PATTERNS"; then
52+
continue
53+
fi
54+
55+
# Check if file should be excluded
56+
if echo "$file" | grep -qE "$EXCLUDE_PATTERNS"; then
57+
continue
58+
fi
59+
60+
# Find trailing whitespace lines, excluding XML doc placeholder lines that are exactly "/// " (one space)
61+
MATCHES=$(grep -n '[[:space:]]$' "$file" | grep -vE '^[0-9]+:[[:space:]]*/// $' || true)
62+
63+
if [ -n "$MATCHES" ]; then
64+
echo "❌ Trailing whitespace found in: $file"
65+
echo "$MATCHES" | head -10
66+
TOTAL=$(echo "$MATCHES" | wc -l)
67+
if [ "$TOTAL" -gt 10 ]; then
68+
echo " ... and $(($TOTAL - 10)) more lines"
69+
fi
70+
echo "1" >> "$TEMP_FILE"
71+
fi
72+
done <<< "$CHANGED_FILES"
73+
74+
ERRORS_FOUND=$(wc -l < "$TEMP_FILE" 2>/dev/null || echo "0")
75+
rm -f "$TEMP_FILE"
76+
77+
if [ "$ERRORS_FOUND" -gt 0 ]; then
78+
echo ""
79+
echo "❌ Found trailing whitespace in $ERRORS_FOUND file(s)."
80+
echo "Please remove trailing whitespace from the files listed above."
81+
exit 1
82+
else
83+
echo "✅ No trailing whitespace found in changed files."
84+
exit 0
85+
fi

Changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# 0.2.0
2+
3+
## ElectronNET.Core
4+
5+
- Updated dependencies (#930) @softworkz
6+
- Updated integration tests (#931) @softworkz
7+
- Updated `ElectronNET.Host` (#935) @softworkz
8+
- Removed transition period specific build configuration (#928) @softworkz
9+
- Added `IsRunningBlazor` option to `BrowserWindowOptions` (#926)
10+
- Added platform support attributes (#929) @softworkz
11+
112
# 0.1.0
213

314
## ElectronNET.Core

0 commit comments

Comments
 (0)