Skip to content

Fix erronsous MemoryStreamSlim access modifiers on some properties #14

Fix erronsous MemoryStreamSlim access modifiers on some properties

Fix erronsous MemoryStreamSlim access modifiers on some properties #14

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@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
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@v7
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: 120
# 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@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: test-release-artifacts
path: artifacts
# upload-artifact / download-artifact do not preserve Unix mode bits; xUnit v3 execs the
# apphost (path without .dll). Without +x, launch fails with Permission denied (Win32Exception 13).
- name: Restore execute bit on ELF outputs under artifacts/bin
run: |
set -euo pipefail
command -v file >/dev/null || { echo "file command not found"; exit 1; }
if [ -d artifacts/bin ]; then
while IFS= read -r -d '' f; do
if file -b "$f" | grep -qiE 'ELF.*executable'; then
chmod +x "$f"
fi
done < <(find artifacts/bin -type f -print0)
fi
- 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)."
# Only test projects that define TestMode=Explicit tests. Solution-wide `dotnet test`
# fails on other assemblies with: No test matches the given testcase filter.
# `dotnet test` accepts one .csproj per invocation (SDK 10+).
- name: Test (Explicit only, sequential xUnit)
run: |
set -euo pipefail
explicit_projects=(
Source/Tst/KZDev.PerfUtils.Memory.Heap.Sequential.UnitTests/KZDev.PerfUtils.Memory.Heap.Sequential.UnitTests.csproj
Source/Tst/KZDev.PerfUtils.Memory.Heap.UnitTests/KZDev.PerfUtils.Memory.Heap.UnitTests.csproj
Source/Tst/KZDev.PerfUtils.Memory.Native.UnitTests/KZDev.PerfUtils.Memory.Native.UnitTests.csproj
Source/Tst/KZDev.PerfUtils.Memory.Fixed.UnitTests/KZDev.PerfUtils.Memory.Fixed.UnitTests.csproj
Source/Tst/KZDev.PerfUtils.Memory.UnitTests/KZDev.PerfUtils.Memory.UnitTests.csproj
)
for proj in "${explicit_projects[@]}"; do
dotnet test "$proj" -c Release --no-build \
--filter "TestMode=Explicit" \
-- xUnit.Explicit=only xUnit.MaxParallelThreads=1 xUnit.ParallelizeAssembly=false xUnit.ParallelizeTestCollections=false
done