forked from Manuel/meeting-assistant
ci: consolidate platform pipelines and test prerequisites on macOS support
This commit is contained in:
1 parent
1b19b08f2e
commit
728e66dd72
76 files changed
+7477
-239
No files matched your search
@@ -6,12 +6,15 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
windows-build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
|
||||
DOTNET_NOLOGO: "1"
|
||||
WINEDEBUG: "-all"
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -22,6 +25,14 @@ jobs:
|
||||
with:
|
||||
dotnet-version: "10.0.x"
|
||||
|
||||
- name: Record Windows validation identity
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p artifacts/tests/windows
|
||||
git rev-parse HEAD > artifacts/tests/windows/commit.txt
|
||||
dotnet --info > artifacts/tests/windows/linux-sdk.txt
|
||||
echo "WINEPREFIX=${RUNNER_TEMP}/meeting-assistant-wine" >> "${GITHUB_ENV}"
|
||||
|
||||
- name: Install Wine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -42,25 +53,11 @@ jobs:
|
||||
WINE_BIN="/opt/wine-stable/bin/wine"
|
||||
test -x "${WINE_BIN}"
|
||||
echo "WINE_BIN=${WINE_BIN}" >> "${GITHUB_ENV}"
|
||||
"${WINE_BIN}" --version
|
||||
|
||||
- name: Restore (portable tests for Windows/Wine)
|
||||
run: |
|
||||
dotnet restore MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
-r win-x64
|
||||
|
||||
- name: Build (portable tests for Windows/Wine)
|
||||
run: |
|
||||
dotnet build MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-c Release \
|
||||
--no-restore \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
-p:RuntimeIdentifier=win-x64 \
|
||||
--nologo
|
||||
"${WINE_BIN}" --version | tee artifacts/tests/windows/wine-version.txt
|
||||
|
||||
- name: Install Windows .NET SDK for Wine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
SDK_VERSION="$(dotnet --version)"
|
||||
WIN_DOTNET_DIR="${RUNNER_TEMP}/dotnet-win"
|
||||
WIN_DOTNET_ZIP="${RUNNER_TEMP}/dotnet-sdk-win-x64.zip"
|
||||
@@ -71,10 +68,11 @@ jobs:
|
||||
mkdir -p "${WIN_DOTNET_DIR}"
|
||||
unzip -oq "${WIN_DOTNET_ZIP}" -d "${WIN_DOTNET_DIR}"
|
||||
echo "WIN_DOTNET_DIR=${WIN_DOTNET_DIR}" >> "${GITHUB_ENV}"
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" --info
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" --info 2>&1 | tee artifacts/tests/windows/windows-sdk.txt
|
||||
|
||||
- name: Provision NuGet signature trust inside Wine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
SDK_VERSION="$(dotnet --version)"
|
||||
SDK_TRUST_ROOT="${DOTNET_ROOT}/sdk/${SDK_VERSION}/trustedroots"
|
||||
dotnet publish scripts/wine-sdk-trust.cs \
|
||||
@@ -82,47 +80,92 @@ jobs:
|
||||
-p:UseAppHost=false \
|
||||
-p:PublishAot=false \
|
||||
-o "${RUNNER_TEMP}/wine-sdk-trust" \
|
||||
--nologo
|
||||
--nologo 2>&1 | tee artifacts/tests/windows/trust-helper-build.log
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" \
|
||||
"Z:${RUNNER_TEMP}/wine-sdk-trust/WineSdkTrust.dll" --import \
|
||||
"Z:${SDK_TRUST_ROOT}/codesignctl.pem" \
|
||||
"Z:${SDK_TRUST_ROOT}/timestampctl.pem"
|
||||
"Z:${SDK_TRUST_ROOT}/timestampctl.pem" \
|
||||
2>&1 | tee artifacts/tests/windows/nuget-trust.log
|
||||
|
||||
- name: Diagnose Windows SDK targeting-pack resolution
|
||||
run: |
|
||||
find "${WIN_DOTNET_DIR}/packs" -maxdepth 4 -name PackageOverrides.txt -print
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" msbuild MeetingAssistant/MeetingAssistant.csproj \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
-p:TargetFramework=net10.0 \
|
||||
-getProperty:NetCoreRoot,NetCoreTargetingPackRoot,PrunePackageDataRoot,PrunePackageTargetingPackRoots,MSBuildSDKsPath,DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" msbuild MeetingAssistant/MeetingAssistant.csproj \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
-p:TargetFramework=net10.0 \
|
||||
-t:AddPrunePackageReferences \
|
||||
-v:normal
|
||||
set -euo pipefail
|
||||
{
|
||||
find "${WIN_DOTNET_DIR}/packs" -maxdepth 4 -name PackageOverrides.txt -print
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" msbuild MeetingAssistant/MeetingAssistant.csproj \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
-p:TargetFramework=net10.0-windows10.0.19041.0 \
|
||||
-getProperty:NetCoreRoot,NetCoreTargetingPackRoot,PrunePackageDataRoot,PrunePackageTargetingPackRoots,MSBuildSDKsPath,DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" msbuild MeetingAssistant/MeetingAssistant.csproj \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
-p:TargetFramework=net10.0-windows10.0.19041.0 \
|
||||
-t:AddPrunePackageReferences \
|
||||
-v:normal
|
||||
} 2>&1 | tee artifacts/tests/windows/targeting-pack-diagnostics.log
|
||||
|
||||
- name: Restore the Windows test and application targets via Wine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" restore MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-p:TargetFramework=net10.0-windows10.0.19041.0 \
|
||||
-p:EnableWindowsTargeting=true -r win-x64 \
|
||||
2>&1 | tee artifacts/tests/windows/restore.log
|
||||
|
||||
- name: Build Windows desktop target via Wine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -f MeetingAssistant/bin/Release/net10.0-windows10.0.19041.0/win-x64/MeetingAssistant.dll
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" build MeetingAssistant/MeetingAssistant.csproj \
|
||||
-c Release \
|
||||
-f net10.0-windows10.0.19041.0 \
|
||||
-r win-x64 \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
--nologo
|
||||
--nologo 2>&1 | tee artifacts/tests/windows/application-build.log
|
||||
test -s MeetingAssistant/bin/Release/net10.0-windows10.0.19041.0/win-x64/MeetingAssistant.dll
|
||||
|
||||
- name: Run tests via Wine (Windows dotnet host)
|
||||
- name: Build the actual Windows test target via Wine
|
||||
run: |
|
||||
rm -f artifacts/tests/wine.trx
|
||||
set -euo pipefail
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" build MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-c Release -f net10.0-windows10.0.19041.0 -r win-x64 \
|
||||
--no-restore -p:EnableWindowsTargeting=true --nologo \
|
||||
2>&1 | tee artifacts/tests/windows/test-build.log
|
||||
|
||||
- name: Discover Windows cases via Wine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" test MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-c Release -f net10.0-windows10.0.19041.0 -r win-x64 \
|
||||
--no-build --list-tests --nologo \
|
||||
2>&1 | tee artifacts/tests/windows/discovery.txt
|
||||
|
||||
- name: Execute Windows cases via Wine
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -f artifacts/tests/windows/windows.trx
|
||||
"${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" test MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-c Release \
|
||||
-f net10.0-windows10.0.19041.0 \
|
||||
-r win-x64 \
|
||||
--no-build \
|
||||
--logger "trx;LogFileName=wine.trx" \
|
||||
--results-directory artifacts/tests \
|
||||
--nologo
|
||||
test -s artifacts/tests/wine.trx
|
||||
--logger "trx;LogFileName=windows.trx" \
|
||||
--results-directory artifacts/tests/windows \
|
||||
--nologo 2>&1 | tee artifacts/tests/windows/execution.log
|
||||
test -s artifacts/tests/windows/windows.trx
|
||||
|
||||
- name: Verify Windows discovery and executed assertions
|
||||
run: |
|
||||
set -euo pipefail
|
||||
dotnet run tools/VerifyPlatformTests.cs -- windows \
|
||||
artifacts/tests/windows/discovery.txt artifacts/tests/windows/windows.trx \
|
||||
2>&1 | tee artifacts/tests/windows/verification.txt
|
||||
|
||||
- name: Retain Windows evidence including incomplete builds
|
||||
if: always()
|
||||
uses: https://github.com/christopherhx/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: windows-target-evidence
|
||||
path: artifacts/tests/windows/
|
||||
|
||||
- name: Show test output folder on failure
|
||||
if: failure()
|
||||
@@ -137,6 +180,9 @@ jobs:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
|
||||
DOTNET_NOLOGO: "1"
|
||||
TZ: "Europe/Berlin"
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
@@ -149,30 +195,59 @@ jobs:
|
||||
|
||||
- name: Restore (portable target)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p artifacts/tests/portable
|
||||
git rev-parse HEAD > artifacts/tests/portable/commit.txt
|
||||
dotnet --info > artifacts/tests/portable/sdk.txt
|
||||
dotnet restore MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-p:EnableWindowsTargeting=true
|
||||
-p:TargetFramework=net10.0 \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
2>&1 | tee artifacts/tests/portable/restore.log
|
||||
|
||||
- name: Build (portable target including macOS managed adapters)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
dotnet build MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-c Release \
|
||||
-f net10.0 \
|
||||
--no-restore \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
--nologo
|
||||
--nologo 2>&1 | tee artifacts/tests/portable/test-build.log
|
||||
|
||||
- name: Discover portable cases
|
||||
run: |
|
||||
set -euo pipefail
|
||||
dotnet test MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-c Release -f net10.0 --no-build --list-tests --nologo \
|
||||
2>&1 | tee artifacts/tests/portable/discovery.txt
|
||||
|
||||
- name: Run portable and macOS managed behavior tests on Ubuntu
|
||||
run: |
|
||||
rm -f artifacts/tests/portable.trx
|
||||
set -euo pipefail
|
||||
rm -f artifacts/tests/portable/portable.trx
|
||||
dotnet test MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \
|
||||
-c Release \
|
||||
-f net10.0 \
|
||||
--no-build \
|
||||
-p:EnableWindowsTargeting=true \
|
||||
--logger "trx;LogFileName=portable.trx" \
|
||||
--results-directory artifacts/tests \
|
||||
--nologo
|
||||
test -s artifacts/tests/portable.trx
|
||||
--results-directory artifacts/tests/portable \
|
||||
--nologo 2>&1 | tee artifacts/tests/portable/execution.log
|
||||
test -s artifacts/tests/portable/portable.trx
|
||||
|
||||
- name: Verify portable discovery and honest skips
|
||||
run: |
|
||||
set -euo pipefail
|
||||
dotnet run tools/VerifyPlatformTests.cs -- portable \
|
||||
artifacts/tests/portable/discovery.txt artifacts/tests/portable/portable.trx \
|
||||
2>&1 | tee artifacts/tests/portable/verification.txt
|
||||
|
||||
- name: Retain portable evidence
|
||||
if: always()
|
||||
uses: https://github.com/christopherhx/gitea-upload-artifact@v4
|
||||
with:
|
||||
name: portable-target-evidence
|
||||
path: artifacts/tests/portable/
|
||||
|
||||
- name: Show test output folder on failure
|
||||
if: failure()
|
||||
@@ -180,3 +255,30 @@ jobs:
|
||||
find artifacts/tests -type f -print || true
|
||||
find MeetingAssistant.Tests -type d -name TestResults -print || true
|
||||
find MeetingAssistant.Tests -type f -path "*/TestResults/*" -maxdepth 5 -print || true
|
||||
macos-native-full:
|
||||
needs: [windows-build-and-test, portable-build-and-test]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 180
|
||||
env:
|
||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
|
||||
DOTNET_NOLOGO: "1"
|
||||
steps:
|
||||
- name: Checkout exact native CI candidate
|
||||
uses: actions/checkout@v7
|
||||
- name: Setup .NET orchestration SDK
|
||||
uses: actions/setup-dotnet@v6
|
||||
with:
|
||||
dotnet-version: "10.0.x"
|
||||
- name: Run owned macOS 13 KVM guest and all native tests
|
||||
run: dotnet run --file tools/ci/MacOsNativeDiagnostic.cs -- --run --full --recovery-format raw --output artifacts/native-macos-full
|
||||
- name: Always remove only this run's owned resources
|
||||
if: always()
|
||||
run: dotnet run --file tools/ci/MacOsNativeDiagnostic.cs -- --cleanup --output artifacts/native-macos-full
|
||||
- name: Retain native build, signatures, TRX and guest receipts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: native-macos-full
|
||||
path: artifacts/native-macos-full/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
Reference in new issue
Block a user