name: PR and Push Build/Test on: pull_request: push: # This temporary branch changes only the native prerequisite diagnostic. # Its manual workflow provides that evidence; the PR branch still runs all jobs. branches-ignore: - codex/macos-ci-kvm-compatibility - codex/macos-ci-tcg-supported - codex/macos-native-full-tcg workflow_dispatch: jobs: build-and-test: runs-on: ubuntu-latest env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" DOTNET_NOLOGO: "1" WINEDEBUG: "-all" steps: - name: Checkout repository uses: actions/checkout@v7 - name: Setup .NET uses: actions/setup-dotnet@v6 with: dotnet-version: "10.0.x" - name: Install Wine run: | set -euo pipefail export DEBIAN_FRONTEND=noninteractive sudo dpkg --add-architecture i386 sudo apt-get update sudo apt-get install -y --no-install-recommends ca-certificates curl gnupg winbind unzip sudo install -d -m 0755 /etc/apt/keyrings curl -fsSL https://dl.winehq.org/wine-builds/winehq.key \ | gpg --dearmor \ | sudo tee /etc/apt/keyrings/winehq-archive.key >/dev/null . /etc/os-release curl -fsSL "https://dl.winehq.org/wine-builds/ubuntu/dists/${VERSION_CODENAME}/winehq-${VERSION_CODENAME}.sources" \ | sudo tee /etc/apt/sources.list.d/winehq.sources >/dev/null sudo apt-get update # Wine 9 cannot enumerate the DOS_DOT patterns used by .NET 10's SDK pack lookup. sudo apt-get install -y --no-install-recommends "winehq-stable=11.0.0.0~${VERSION_CODENAME}-1" 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 - name: Install Windows .NET SDK for Wine run: | SDK_VERSION="$(dotnet --version)" WIN_DOTNET_DIR="${RUNNER_TEMP}/dotnet-win" WIN_DOTNET_ZIP="${RUNNER_TEMP}/dotnet-sdk-win-x64.zip" echo "Using SDK version: ${SDK_VERSION}" curl -fSL "https://builds.dotnet.microsoft.com/dotnet/Sdk/${SDK_VERSION}/dotnet-sdk-${SDK_VERSION}-win-x64.zip" -o "${WIN_DOTNET_ZIP}" rm -rf "${WIN_DOTNET_DIR}" 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 - name: Provision NuGet signature trust inside Wine run: | SDK_VERSION="$(dotnet --version)" SDK_TRUST_ROOT="${DOTNET_ROOT}/sdk/${SDK_VERSION}/trustedroots" dotnet publish scripts/wine-sdk-trust.cs \ -c Release \ -p:UseAppHost=false \ -p:PublishAot=false \ -o "${RUNNER_TEMP}/wine-sdk-trust" \ --nologo "${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" - 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 - name: Build Windows desktop target via Wine run: | 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 test -s MeetingAssistant/bin/Release/net10.0-windows10.0.19041.0/win-x64/MeetingAssistant.dll - name: Run tests via Wine (Windows dotnet host) run: | rm -f artifacts/tests/wine.trx "${WINE_BIN}" "${WIN_DOTNET_DIR}/dotnet.exe" test MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \ -c Release \ -r win-x64 \ --no-build \ --logger "trx;LogFileName=wine.trx" \ --results-directory artifacts/tests \ --nologo test -s artifacts/tests/wine.trx - name: Show test output folder on failure if: failure() run: | 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: [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 14 TCG guest and all native tests run: dotnet run --file tools/ci/MacOsNativeDiagnostic.cs -- --run --full --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 portable-build-and-test: runs-on: ubuntu-latest env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" DOTNET_NOLOGO: "1" TZ: "Europe/Berlin" steps: - name: Checkout repository uses: actions/checkout@v7 - name: Setup .NET uses: actions/setup-dotnet@v6 with: dotnet-version: "10.0.x" - name: Restore (portable target) run: | dotnet restore MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \ -p:EnableWindowsTargeting=true - name: Build (portable target including macOS managed adapters) run: | dotnet build MeetingAssistant.Tests/MeetingAssistant.Tests.csproj \ -c Release \ -f net10.0 \ --no-restore \ -p:EnableWindowsTargeting=true \ --nologo - name: Run portable and macOS managed behavior tests on Ubuntu run: | rm -f artifacts/tests/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 - name: Show test output folder on failure if: failure() run: | 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