Skip to content

Commit 825c240

Browse files
committed
Add test workflow
1 parent aba169e commit 825c240

2 files changed

Lines changed: 449 additions & 0 deletions

File tree

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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+
cache: 'npm'
47+
48+
- name: Restore
49+
run: dotnet restore -r ${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
50+
51+
- name: Build
52+
run: dotnet build --no-restore -c Release -r ${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
53+
54+
- name: Install Linux GUI dependencies
55+
if: runner.os == 'Linux'
56+
run: |
57+
sudo apt-get update
58+
sudo apt-get install -y xvfb \
59+
libgtk-3-0 libnss3 libgdk-pixbuf2.0-0 libdrm2 libgbm1 libasound2 libxss1 libxtst6 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libx11-xcb1
60+
61+
- name: Run tests (Linux)
62+
if: runner.os == 'Linux'
63+
run: |
64+
mkdir -p test-results
65+
xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
66+
-c Release --no-build -r ${{ matrix.rid }} \
67+
--logger "trx;LogFileName=TestResults.trx" \
68+
--results-directory test-results
69+
70+
- name: Run tests (Windows)
71+
if: runner.os == 'Windows'
72+
run: |
73+
mkdir test-results
74+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
75+
-c Release --no-build -r ${{ matrix.rid }} \
76+
--logger "trx;LogFileName=TestResults.trx" \
77+
--results-directory test-results
78+
79+
- name: Upload raw test results
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: test-results-${{ matrix.os }}
83+
path: test-results/*.trx
84+
retention-days: 7
85+
86+
- name: Publish Test Results (Checks UI)
87+
uses: EnricoMi/publish-unit-test-result-action@v2
88+
if: always()
89+
with:
90+
files: test-results/*.trx
91+
check_name: ElectronNET Integration Tests (${{ matrix.os }})
92+
comment_mode: off
93+
94+
summary:
95+
name: Aggregate
96+
runs-on: ubuntu-latest
97+
needs: [tests]
98+
steps:
99+
- name: Summary
100+
run: echo "All matrix test jobs completed."

0 commit comments

Comments
 (0)