Skip to content

Run CI tests against .NET 4.6.2 as well #24

Run CI tests against .NET 4.6.2 as well

Run CI tests against .NET 4.6.2 as well #24

Workflow file for this run

name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.dotnet.os }}-latest
strategy:
matrix:
dotnet: [
{ os: 'windows', version: '2', tfm: 'net20' },
{ os: 'windows', version: '4', tfm: 'net462' },
{ os: 'ubuntu', version: '3.1', tfm: 'netcoreapp3.1' },
{ os: 'ubuntu', version: '8', tfm: 'net8.0' },
]
steps:
- uses: actions/checkout@v4
- name: Setup .NET
if: contains(matrix.dotnet.tfm, '.') # only for .NET core
uses: actions/setup-dotnet@v4
id: stepid
with:
dotnet-version: ${{ matrix.dotnet.version }}
# Without global.json, tests will be executed under the latest installed version!
- name: Create temporary global.json
if: contains(matrix.dotnet.tfm, '.') # only for .NET core
run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json
- name: Restore packages
run: dotnet restore UrlBase64/UrlBase64.csproj -p:Configuration=Release -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" --verbosity normal
- name: Build solution
run: dotnet build UrlBase64/UrlBase64.csproj -p:Configuration=Release -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" --verbosity normal
- name: Run tests
if: matrix.dotnet.tfm != 'net20'
run: dotnet test -p:Configuration=Release --verbosity normal -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest"