Skip to content

Add UsingTaskRoslynCodeTaskFactory convenience method #544

Add UsingTaskRoslynCodeTaskFactory convenience method

Add UsingTaskRoslynCodeTaskFactory convenience method #544

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
- rel/*
pull_request:
branches:
- main
- rel/*
env:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Debug'
BuildPlatform: 'Any CPU'
ContinuousIntegrationBuild: 'true'
DotNet6Version: '6.x'
DotNet8Version: '8.x'
DotNet9Version: '9.x'
VsTestUseMSBuildOutput: 'false'
jobs:
BuildAndTest:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
name: Windows
- os: ubuntu-latest
name: Linux
- os: macos-latest
name: MacOS
fail-fast: false
name: Build and Test (${{ matrix.name }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET ${{ env.DotNet6Version }} and .NET ${{ env.DotNet8Version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
${{ env.DotNet6Version }}
${{ env.DotNet8Version }}
- name: Install .NET ${{ env.DotNet9Version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DotNet9Version }}
dotnet-quality: 'preview'
- name: Build Solution
run: dotnet build "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/build.binlog"
- name: Run Unit Tests (.NET Framework)
if: ${{ matrix.name == 'Windows' }}
run: dotnet test --logger trx --no-restore --no-build --framework net472 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net472.binlog"
- name: Run Unit Tests (.NET 6)
if: ${{ matrix.name != 'MacOS' }}
run: dotnet test --logger trx --no-restore --no-build --framework net6.0 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net6.0.binlog"
- name: Run Unit Tests (.NET 8)
run: dotnet test --logger trx --no-restore --no-build --framework net8.0 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net8.0.binlog"
- name: Run Unit Tests (.NET 9)
run: dotnet test --logger trx --no-restore --no-build --framework net9.0 /noautorsp "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net9.0.binlog"
- name: Upload Test Results
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ matrix.name }}
path: '**/TestResults/*.trx'
if-no-files-found: error
- name: Upload Artifacts
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ env.ArtifactsDirectoryName }}-${{ matrix.name }}
path: ${{ env.ArtifactsDirectoryName }}