Bump Microsoft.NET.Test.Sdk from 17.7.2 to 17.8.0 #174
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: "Build" | |
on: | |
push: | |
branches: ["main"] | |
paths-ignore: | |
- "**/*.md" | |
- "**/*.gitignore" | |
- "**/*.gitattributes" | |
pull_request: | |
branches: ["main"] | |
paths-ignore: | |
- "**/*.md" | |
- "**/*.gitignore" | |
- "**/*.gitattributes" | |
workflow_dispatch: {} | |
jobs: | |
build-linux: | |
name: "Build: Linux" | |
runs-on: ubuntu-latest | |
env: | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 | |
DOTNET_NOLOGO: true | |
DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
DOTNET_ADD_GLOBAL_TOOLS_TO_PATH: false | |
DOTNET_MULTILEVEL_LOOKUP: 0 | |
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: true | |
TERM: xterm | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Trunk Check | |
uses: trunk-io/trunk-action@v1 | |
- name: "Setup: .NET Core 3.1 SDK" | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 3.1.x | |
- name: "Setup: .NET Core 6.0 SDK" | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: "Setup: GitVersion" | |
uses: gittools/actions/gitversion/setup@v0.9.7 | |
with: | |
versionSpec: "5.x" | |
- name: "Compute: Version" | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v0.9.7 | |
with: | |
useConfigFile: true | |
- name: "Display: version outputs" | |
run: | | |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}" | |
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" | |
- name: "Restore: packages" | |
run: dotnet restore src/NClap.sln | |
- name: "Build: Linux (release)" | |
run: | | |
dotnet-gitversion /updateprojectfiles | |
dotnet build src/NClap.sln --no-restore -c Release | |
- name: "Package (release)" | |
run: dotnet pack src/NClap.sln --no-build --no-restore -c Release | |
- name: "Install: mono" | |
run: | | |
sudo apt install -y gnupg ca-certificates | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF | |
echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list | |
sudo apt update | |
sudo apt install -y mono-devel | |
- name: "Test: .NET Framework 4.6.1 (via mono)" | |
run: dotnet test src/Tests/UnitTests/bin/Release/net461/NClap.Tests.dll | |
- name: "Test: .NET Core 3.1" | |
run: dotnet test src/NClap.sln --no-build --no-restore -c Release --verbosity normal -f netcoreapp3.1 | |
- name: "Test: .NET 6.0 (with coverage)" | |
run: dotnet test src/NClap.sln --no-build --no-restore -c Release --verbosity normal -f net6.0 --collect:"XPlat Code Coverage" --results-directory ./coverage | |
- name: "Test: Generate Code Coverage Report" | |
uses: irongut/CodeCoverageSummary@v1.3.0 | |
with: | |
filename: coverage/**/coverage.cobertura.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: "80 90" | |
# - name: "Test: Add Coverage PR Comment" | |
# uses: marocchino/sticky-pull-request-comment@v2 | |
# if: github.event_name == 'pull_request' | |
# with: | |
# recreate: true | |
# path: code-coverage-results.md | |
- name: "Upload: Binaries" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-binaries | |
path: src/NClap/bin/Release | |
- name: "Upload: Package files" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-packages | |
path: src/NClap/bin/Release/*.nupkg | |
build-windows: | |
name: "Build: Windows" | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "Setup: .NET Core 3.1 SDK" | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 3.1.x | |
- name: "Setup: .NET Core 6.0 SDK" | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 6.0.x | |
- name: "Setup: GitVersion" | |
uses: gittools/actions/gitversion/setup@v0.9.7 | |
with: | |
versionSpec: "5.x" | |
- name: "Compute: Version" | |
id: gitversion | |
uses: gittools/actions/gitversion/execute@v0.9.7 | |
with: | |
useConfigFile: true | |
- name: "Display: version outputs" | |
run: | | |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}" | |
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" | |
- name: "Restore: packages" | |
run: dotnet restore src/NClap.sln | |
- name: "Build: Windows (release)" | |
run: | | |
dotnet-gitversion /updateprojectfiles | |
dotnet build src/NClap.sln --no-restore -c Release | |
- name: "Package (release)" | |
run: dotnet pack src/NClap.sln --no-build --no-restore -c Release | |
- name: "Test: .NET Framework 4.6.1" | |
run: dotnet test src/Tests/UnitTests/bin/Release/net461/NClap.Tests.dll | |
- name: "Test: .NET Core 3.1" | |
run: dotnet test src/NClap.sln --no-build --no-restore -c Release -f netcoreapp3.1 | |
- name: "Test: .NET 6.0" | |
run: dotnet test src/NClap.sln --no-build --no-restore -c Release -f net6.0 | |
- name: "Upload: Binaries" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-binaries | |
path: src\NClap\bin\Release | |
- name: "Upload: Package files" | |
uses: actions/upload-artifact@v3 | |
with: | |
name: windows-packages | |
path: src\NClap\bin\Release\*.nupkg |