Skip to content

Remove tests for app badgecount #21

Remove tests for app badgecount

Remove tests for app badgecount #21

name: Tests
on:
push:
branches: [ develop, main ]
pull_request:
branches: [ develop, main ]
concurrency:
group: integration-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Integration Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
rid: linux-x64
- os: windows-2022
rid: win-x64
- os: macos-14
rid: osx-arm64
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
CI: true
ELECTRON_ENABLE_LOGGING: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Restore
run: dotnet restore -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
- name: Build
run: dotnet build --no-restore -c Release -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj
- name: Install Linux GUI dependencies
if: runner.os == 'Linux'
run: |
set -e
sudo apt-get update
# Core Electron dependencies
sudo apt-get install -y xvfb \
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
- name: Run tests (Linux)
if: runner.os == 'Linux'
continue-on-error: true
run: |
mkdir -p test-results/Ubuntu
xvfb-run -a dotnet test src/ElectronNET.IntegrationTests/ElectronNET.IntegrationTests.csproj \
-c Release --no-build -r ${{ matrix.rid }} -p:RuntimeIdentifier=${{ matrix.rid }} \
--logger "trx;LogFileName=Ubuntu.trx" \
--logger "console;verbosity=detailed" \
--results-directory test-results
- name: Run tests (Windows)
if: runner.os == 'Windows'
continue-on-error: true
run: |
New-Item -ItemType Directory -Force -Path test-results/Windows | Out-Null
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
- name: Run tests (macOS)
if: runner.os == 'macOS'
continue-on-error: true
run: |
mkdir -p test-results/macOS
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
- name: Upload raw test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: test-results/*.trx
retention-days: 7
- name: Publish Test Results
if: always()
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with:
files: test-results/**/*.trx
check_name: Integration Tests (${{ matrix.os }})
comment_mode: off
check_run: false
summary:
name: Aggregate
runs-on: ubuntu-24.04
if: always()
needs: [tests]
steps:
- name: Download all test results
uses: actions/download-artifact@v4
with:
path: test-results
# --- CTRF: setup & convert all TRX to CTRF in the aggregate job ---
- name: Setup .NET (for CTRF conversion)
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install CTRF TRX→CTRF converter (dotnet tool)
run: |
dotnet new tool-manifest
dotnet tool install DotnetCtrfJsonReporter --local
- name: Convert TRX → CTRF (per downloaded artifact)
shell: bash
run: |
set -euo pipefail
mkdir -p ctrf
shopt -s globstar nullglob
conv=0
# Expect structure like: test-results/test-results-ubuntu-24.04/*.trx
for f in test-results/**/*.trx; do
envname="$(basename "$(dirname "$f")")"
# Fallback if the trx sits directly in test-results/
[[ "$envname" == "test-results" ]] && envname="unknown"
outdir="ctrf/${envname}"
mkdir -p "$outdir"
# Produce: ctrf/<env>/ctrf-report.json
dotnet tool run DotnetCtrfJsonReporter -p "$f" -d "$outdir" -f "ctrf-report.json"
echo "Converted $f -> $outdir/ctrf-report.json"
conv=$((conv+1))
done
echo "Converted $conv TRX file(s) to CTRF"
- name: Upload CTRF reports (for history & insights)
if: always()
uses: actions/upload-artifact@v4
with:
name: ctrf-reports
path: ctrf/**/*.json
retention-days: 7
- name: Publish CTRF Test Report (all features)
if: always()
uses: ctrf-io/github-test-reporter@v1
with:
# Pick up every CTRF we just created (one per OS/artifact)
report-path: 'ctrf/**/*.json'
# Post everywhere (job summary, PR comment, a status check)
summary: true
pull-request: true
status-check: true
status-check-name: 'CTRF Test Reporter'
# Turn on (almost) all built-in reports
summary-report: true
summary-delta-report: true
tests-changed-report: true
github-report: true
test-report: true
test-list-report: true
failed-report: true
failed-folded-report: true
skipped-report: true
suite-folded-report: true
suite-list-report: true
file-report: true
previous-results-report: true
insights-report: true
flaky-report: true
flaky-rate-report: true
fail-rate-report: true
slowest-report: true
# Store processed CTRF for comparisons on future runs
upload-artifact: true
fetch-previous-results: true
# Optional: make the order explicit
report-order: 'summary-report,summary-delta-report,tests-changed-report,failed-report,failed-folded-report,flaky-report,flaky-rate-report,fail-rate-report,slowest-report,skipped-report,suite-folded-report,suite-list-report,file-report,test-report,test-list-report,previous-results-report,github-report'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "test-results/**/*.trx"
check_name: "Integration Tests Combined"
comment_mode: always
check_run: true
check_run_annotations: all tests
check_run_annotations_branch: "*"
report_individual_runs: true
test_file_prefix: "+src/"
report_suite_logs: any
fail_on: test failures
- name: Summary
run: echo "All matrix test jobs completed."