Skip to content

Set Concurrency test loop count to a more reasonable value. #3

Set Concurrency test loop count to a more reasonable value.

Set Concurrency test loop count to a more reasonable value. #3

Workflow file for this run

name: Build / Test
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
test-standard:
name: test-standard
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.x
- name: Restore
run: dotnet restore Source/KZDev.PerfUtils.slnx
- name: Build
run: dotnet build Source/KZDev.PerfUtils.slnx -c Release
- name: Test (standard)
run: dotnet test Source/KZDev.PerfUtils.slnx -c Release --no-build
- name: Upload Release artifacts
uses: actions/upload-artifact@v4
with:
name: test-release-artifacts
path: artifacts
if-no-files-found: error
test-explicit:
name: test-explicit
needs: [test-standard]
runs-on: ubuntu-latest
timeout-minutes: 45
# test-explicit failures are non-blocking only for PRs whose base is not main, or for pushes to dev.
# They remain blocking for PRs into main and for pushes to main (aligned with branch-protection intent).
continue-on-error: ${{ (github.event_name == 'pull_request' && github.base_ref != 'main') || (github.event_name == 'push' && github.ref == 'refs/heads/dev') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.x
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: test-release-artifacts
path: artifacts
- name: Apply serialized xUnit runner for Explicit
run: |
set -euo pipefail
count=0
while IFS= read -r -d '' f; do
cp Source/Tst/xunit.runner.explicit.json "$f"
count=$((count + 1))
done < <(find artifacts/bin -name xunit.runner.json -print0)
if [ "$count" -eq 0 ]; then
echo "No xunit.runner.json found under artifacts/bin; cannot apply explicit runner overlay."
exit 1
fi
echo "Overlay applied to ${count} xunit.runner.json file(s)."
- name: Test (Explicit only, sequential xUnit)
run: |
dotnet test Source/KZDev.PerfUtils.slnx -c Release --no-build \
--filter "TestMode=Explicit" \
-- xUnit.Explicit=only xUnit.MaxParallelThreads=1 xUnit.ParallelizeAssembly=false xUnit.ParallelizeTestCollections=false