WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
name: CI
name: Build and Publish

on: [push, pull_request]
on: [push]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}

jobs:
# linux:
# runs-on: ubuntu-latest
# timeout-minutes: 10

# steps:
# - uses: actions/checkout@v4
concurrency:
group: build-publish-${{ github.ref }}
cancel-in-progress: true

# - name: Setup dotnet
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: |
# 6.0.x
# 8.0.x
# 10.0.x

# - name: Build
# run: ./build.sh
jobs:
Integration-Tests:
uses: ./.github/workflows/integration-tests.yml
name: '1'

windows:
Publish:
needs: [Integration-Tests]
runs-on: windows-latest
timeout-minutes: 10
name: '2 / Publish'

steps:
- uses: actions/checkout@v4
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/PR Validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PR Validation

on: [pull_request]

concurrency:
group: pr-validation-${{ github.ref }}
cancel-in-progress: true

jobs:
Whitespace-Check:
uses: ./.github/workflows/trailing-whitespace-check.yml
secrets: inherit
name: '1'

Tests:
needs: Whitespace-Check
uses: ./.github/workflows/integration-tests.yml
secrets: inherit
name: '2'

build:
needs: [Whitespace-Check, Tests]
runs-on: windows-latest
timeout-minutes: 10
name: '3 / Build'

steps:
- uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
10.0.x
- name: Build
run: .\build.ps1
16 changes: 10 additions & 6 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
name: Tests
name: Tests

on:
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]
workflow_call:

concurrency:
group: integration-tests-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Integration Tests (${{ matrix.os }} / Electron ${{ matrix.electronVersion }})
name: ${{ matrix.os }} API-${{ matrix.electronVersion }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -45,6 +42,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Random delay (0-20 seconds)
shell: bash
run: |
DELAY=$((RANDOM % 21))
echo "Waiting for $DELAY seconds..."
sleep $DELAY

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Create PR Comments

on:
workflow_run:
workflows: ["Tests"]
workflows: [ "PR Validation" ]
types: [completed]

permissions:
Expand All @@ -14,7 +14,7 @@ jobs:
pr-comment:
name: Post Test Result as PR comment
runs-on: ubuntu-24.04
if: github.event.workflow_run.event == 'pull_request'
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion != 'cancelled'

steps:
- name: Download CTRF artifact
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/retry-test-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Tests auto-rerun

on:
workflow_run:
workflows: [ "PR Validation", "Build and Publish" ]
types: [ completed ]

jobs:
rerun-failed-matrix-jobs-once:
if: >
${{
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.run_attempt == 1
}}
runs-on: ubuntu-24.04

permissions:
actions: write
contents: read

steps:
- name: Decide whether to rerun (only if matrix jobs failed)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
echo "Inspecting jobs of workflow run $RUN_ID in $REPO"

jobs_json="$(gh api repos/$REPO/actions/runs/$RUN_ID/jobs)"

echo "Jobs and conclusions:"
echo "$jobs_json" | jq '.jobs[] | {name: .name, conclusion: .conclusion}'

failed_matrix_jobs=$(echo "$jobs_json" | jq '
[ .jobs[]
| select(.conclusion == "failure"
and (.name | contains(" API-")))
]
| length
')

echo "Failed Integration Tests matrix jobs: $failed_matrix_jobs"

if [ "$failed_matrix_jobs" -gt 0 ]; then
echo "Detected failing Integration Tests jobs – re-running failed jobs for this run."
gh run rerun "$RUN_ID" --failed
else
echo "Only non-matrix jobs (like Test Results) failed – not auto-rerunning."
fi
7 changes: 3 additions & 4 deletions .github/workflows/trailing-whitespace-check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: Trailing Whitespace Check
name: Whitespace Check

on:
pull_request:
types: [opened, synchronize, reopened]
workflow_call:

jobs:
check-trailing-whitespace:
check-whitespace:
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
4 changes: 3 additions & 1 deletion src/ElectronNET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test Apps", "Test Apps", "{
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{985D39A7-5216-4945-8167-2FD0CB387BD8}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\ci.yml = ..\.github\workflows\ci.yml
..\.github\workflows\Build and Publish.yml = ..\.github\workflows\Build and Publish.yml
..\.github\workflows\integration-tests.yml = ..\.github\workflows\integration-tests.yml
..\.github\workflows\PR Validation.yml = ..\.github\workflows\PR Validation.yml
..\.github\workflows\pr-comment.yml = ..\.github\workflows\pr-comment.yml
..\.github\workflows\publish-wiki.yml = ..\.github\workflows\publish-wiki.yml
..\.github\workflows\retry-test-jobs.yml = ..\.github\workflows\retry-test-jobs.yml
..\.github\workflows\trailing-whitespace-check.yml = ..\.github\workflows\trailing-whitespace-check.yml
EndProjectSection
EndProject
Expand Down
Loading