Bump Microsoft.Build.Artifacts from 5.0.1 to 5.0.8 #125
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- rel/* | |
pull_request: | |
branches: | |
- main | |
- rel/* | |
env: | |
ArtifactsDirectoryName: 'artifacts' | |
TestResultsDirectoryName: 'coverage' | |
CommonTestArguments: '--no-restore --no-build --logger trx /noautorsp' | |
BuildConfiguration: 'Debug' | |
BuildPlatform: 'Any CPU' | |
ContinuousIntegrationBuild: 'true' | |
jobs: | |
BuildAndTest: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
include: | |
- os: windows-latest | |
name: Windows | |
testarguments: '' | |
- os: ubuntu-latest | |
name: Linux | |
testarguments: '--collect:"XPlat Code Coverage"' | |
- os: macos-latest | |
name: MacOS | |
testarguments: '' | |
fail-fast: false | |
name: Build and Test (${{ matrix.name }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Install .NET SDKs | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
3.x | |
6.x | |
7.x | |
- 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 ${{ env.CommonTestArguments }} ${{ matrix.TestArguments}} --framework net472 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net472.binlog" | |
- name: Run Unit Tests (.NET Core 3.1) | |
run: dotnet test ${{ env.CommonTestArguments }} ${{ matrix.TestArguments}} --framework netcoreapp3.1 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-netcoreapp3.1.binlog" | |
- name: Run Unit Tests (.NET 6) | |
run: dotnet test ${{ env.CommonTestArguments }} ${{ matrix.TestArguments}} --framework net6.0 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net6.0.binlog" | |
- name: Code Coverage Report | |
if: ${{ matrix.name == 'Linux' }} | |
uses: irongut/[email protected] | |
with: | |
filename: '**/TestResults/**/coverage.cobertura.xml' | |
badge: true | |
format: markdown | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '60 80' | |
- name: Add Code Coverage Report to Summary | |
if: ${{ matrix.name == 'Linux' }} | |
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v2 | |
if: success() || failure() | |
with: | |
name: test-results-${{ matrix.name }} | |
path: '**/TestResults/*.trx' | |
if-no-files-found: error | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v2 | |
if: success() || failure() | |
with: | |
name: ${{ env.ArtifactsDirectoryName }}-${{ matrix.name }} | |
path: ${{ env.ArtifactsDirectoryName }} |