Skip to content

Add CI

Add CI #4

Workflow file for this run

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