forked from Manuel/meeting-assistant
168 lines
6.4 KiB
YAML
168 lines
6.4 KiB
YAML
name: PR and Push Build/Test
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
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: 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
|
|
|
|
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
|