Skip to content

Commit cc8178e

Browse files
committed
Add test workflow
1 parent aba169e commit cc8178e

2 files changed

Lines changed: 454 additions & 0 deletions

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: ElectronNET Integration 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-latest
22+
rid: linux-x64
23+
- os: windows-latest
24+
rid: win-x64
25+
26+
env:
27+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
28+
DOTNET_NOLOGO: 1
29+
CI: true
30+
ELECTRON_ENABLE_LOGGING: 1
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Setup .NET
37+
uses: actions/setup-dotnet@v4
38+
with:
39+
dotnet-version: '10.0.x'
40+
include-prerelease: false
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '22'
46+
47+
- name: Restore
48+
run: dotnet restore -r ${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
49+
50+
- name: Build
51+
run: dotnet build --no-restore -c Release -r ${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
52+
53+
- name: Install Linux GUI dependencies
54+
if: runner.os == 'Linux'
55+
run: |
56+
set -e
57+
sudo apt-get update
58+
# Core Electron dependencies
59+
sudo apt-get install -y xvfb \
60+
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 || true
61+
# Handle Ubuntu 24.04 time64 transition for ALSA
62+
if ! dpkg -s libasound2 >/dev/null 2>&1; then
63+
sudo apt-get install -y libasound2t64 || true
64+
fi
65+
66+
- name: Run tests (Linux)
67+
if: runner.os == 'Linux'
68+
run: |
69+
mkdir -p test-results
70+
xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
71+
-c Release --no-build -r ${{ matrix.rid }} \
72+
--logger "trx;LogFileName=TestResults.trx" \
73+
--results-directory test-results
74+
75+
- name: Run tests (Windows)
76+
if: runner.os == 'Windows'
77+
run: |
78+
mkdir test-results
79+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
80+
-c Release --no-build -r ${{ matrix.rid }} \
81+
--logger "trx;LogFileName=TestResults.trx" \
82+
--results-directory test-results
83+
84+
- name: Upload raw test results
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: test-results-${{ matrix.os }}
88+
path: test-results/*.trx
89+
retention-days: 7
90+
91+
- name: Publish Test Results (Checks UI)
92+
uses: EnricoMi/publish-unit-test-result-action@v2
93+
if: always()
94+
with:
95+
files: test-results/*.trx
96+
check_name: ElectronNET Integration Tests (${{ matrix.os }})
97+
comment_mode: off
98+
99+
summary:
100+
name: Aggregate
101+
runs-on: ubuntu-latest
102+
needs: [tests]
103+
steps:
104+
- name: Summary
105+
run: echo "All matrix test jobs completed."

0 commit comments

Comments
 (0)