Skip to content

Commit b66ce03

Browse files
ci: stop hanging PR workflows and remove duplicate runs
- Build and Publish now only triggers on push to main/develop (was: every push), so feature-branch pushes no longer run a second full matrix in parallel to PR Validation. - integration-tests concurrency group is now scoped per calling workflow (github.workflow + github.ref), preventing PR Validation and Build and Publish from canceling each other's reusable test runs. - Added timeout-minutes (25 per matrix job, 15 per dotnet test step, 10 for summary job) so a hung Electron process no longer keeps a runner busy until the 6h default timeout, which previously required manual cancel. - Added --blame-hang --blame-hang-timeout 5min to dotnet test so hung tests produce a dump and fail fast instead of stalling. - Removed pointless 0-20s random sleep step at the start of every matrix job.
1 parent 50c9076 commit b66ce03

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/Build and Publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Build and Publish
22

3-
on: [push]
3+
on:
4+
push:
5+
branches: [main, develop]
46

57
env:
68
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/integration-tests.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ on:
44
workflow_call:
55

66
concurrency:
7-
group: integration-tests-${{ github.ref }}
7+
group: integration-tests-${{ github.workflow }}-${{ github.ref }}
88
cancel-in-progress: true
99

1010
jobs:
1111
tests:
1212
name: ${{ matrix.os }} API-${{ matrix.electronVersion }}
1313
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 25
1415
strategy:
1516
fail-fast: false
1617
matrix:
@@ -42,13 +43,6 @@ jobs:
4243
- name: Checkout
4344
uses: actions/checkout@v4
4445

45-
- name: Random delay (0-20 seconds)
46-
shell: bash
47-
run: |
48-
DELAY=$((RANDOM % 21))
49-
echo "Waiting for $DELAY seconds..."
50-
sleep $DELAY
51-
5246
- name: Setup .NET
5347
uses: actions/setup-dotnet@v4
5448
with:
@@ -79,27 +73,31 @@ jobs:
7973
- name: Run tests (Linux)
8074
if: runner.os == 'Linux'
8175
continue-on-error: true
76+
timeout-minutes: 15
8277
run: |
8378
mkdir -p test-results
8479
xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
8580
-c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} \
8681
--logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" \
8782
--logger "console;verbosity=detailed" \
83+
--blame-hang --blame-hang-timeout 5min \
8884
--results-directory test-results
8985
9086
- name: Run tests (Windows)
9187
if: runner.os == 'Windows'
9288
continue-on-error: true
89+
timeout-minutes: 15
9390
run: |
9491
New-Item -ItemType Directory -Force -Path test-results | Out-Null
95-
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
92+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --blame-hang --blame-hang-timeout 5min --results-directory test-results
9693
9794
- name: Run tests (macOS)
9895
if: runner.os == 'macOS'
9996
continue-on-error: true
97+
timeout-minutes: 15
10098
run: |
10199
mkdir -p test-results
102-
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --results-directory test-results
100+
dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj -c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} -p:ElectronVersion=${{ matrix.electronVersion }} --logger "trx;LogFileName=${{ matrix.os }}-electron-${{ matrix.electronVersion }}.trx" --logger "console;verbosity=detailed" --blame-hang --blame-hang-timeout 5min --results-directory test-results
103101
104102
- name: Upload raw test results
105103
if: always()
@@ -114,6 +112,7 @@ jobs:
114112
runs-on: ubuntu-24.04
115113
if: always()
116114
needs: [tests]
115+
timeout-minutes: 10
117116

118117
permissions:
119118
actions: read

0 commit comments

Comments
 (0)