Skip to content

Chasing with sln change #83

Chasing with sln change

Chasing with sln change #83

Workflow file for this run

name: Build and Test
on:
push:
branches: [ master, localbuilding ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build (${{ matrix.platform }})
runs-on: windows-2022
strategy:
matrix:
platform: [ x64, x86, ARM64 ]
configuration: [ LegacyRadegast, RadegastWindows ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
persist-credentials: true
- name: Setup DotNet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Setup MSBuild
shell: pwsh
run: |
$msbuildPath = & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | Select-Object -First 1
$msbuildDir = Split-Path $msbuildPath -Parent
echo "$msbuildDir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Host "Added MSBuild to PATH: $msbuildDir"
- name: Install WiX Toolset
shell: pwsh
run: |
dotnet tool install --global wix --version 7.0.0
wix --version
- name: Set TAG_VERSION
shell: pwsh
run: |
if ("${{ github.ref_type }}" -eq "tag") {
$tag = '${{ github.ref_name }}'
$tagVersion = $tag -replace 'v',''
$tagVersion = "$tagVersion.${{ github.run_number }}"
} else {
$tagVersion = "v3.0.${{ github.run_number }}"
$tagVersion = $tagVersion -replace 'v',''
}
Write-Host "Setting TAG_VERSION to $tagVersion"
echo "TAG_VERSION=$tagVersion" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Restore NuGet packages
run: nuget restore radegast.sln
- name: Restore for platform-specific build
run: msbuild radegast.sln /t:Restore /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
- name: Build solution
run: msbuild radegast.sln /m /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Radegast-${{ matrix.configuration }}-${{ matrix.platform }}-${{ env.TAG_VERSION }}
path: |
bin\Radegast\Release\**
bin\Veles\Release\**
if-no-files-found: warn
test:
name: Test (Radegast.Core)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Run tests
run: dotnet test Radegast.Core.Tests/Radegast.Core.Tests.csproj --framework net10.0
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: Radegast.Core.Tests/TestResults/test-results.trx
test-windows:
name: Test net481 (Windows)
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Run tests (net48)
run: dotnet test Radegast.Core.Tests/Radegast.Core.Tests.csproj --framework net481 --configuration Release --logger "trx;LogFileName=test-results-net481.trx" --verbosity normal
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-net481
path: Radegast.Core.Tests\TestResults\test-results-net481.trx