Skip to content

Added .net 9 support, bumped all unit tests to .Net 9 #321

Added .net 9 support, bumped all unit tests to .Net 9

Added .net 9 support, bumped all unit tests to .Net 9 #321

Workflow file for this run

name: Unit tests
on:
workflow_call: {}
pull_request: { branches: [main] }
jobs:
build-and-test:
runs-on: windows-2022 # needs to be windows because we support .NET framework
timeout-minutes: 30
strategy:
matrix:
dotnet-version:
[
"4.6.1",
"4.7.2",
"4.8.2",
"6.0.x",
"7.0.x",
"8.0.x",
"9.0.x",
]
fail-fast: false
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
~/.local/share/NuGet/v3-cache
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: xt0rted/setup-dotnet@fc29edc677f23f3fa306defaec2fb1104c84cf8a # v1.0.0
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: "[17.2,19.0)"
- name: Install dependencies
run: |
dotnet tool restore
dotnet restore
- name: Build and Test
run: |
dotnet tool install --global Cake.Tool
dotnet cake --target=Test --configuration=Release --framework=${{ matrix.dotnet-version }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage/coverage.xml
fail_ci_if_error: true
slug: AikidoSec/firewall-dotnet