Add CI #13
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: .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 }} | |
if: endsWith(matrix.dotnet.tfm, '.0') # only for .NET core | |
# By default, tests will be executed under the latest installed version! | |
- name: Create temporary global.json | |
if: endsWith(matrix.dotnet.tfm, '.0') # 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 | |
run: dotnet test -p:Configuration=Release --verbosity normal -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" | |
if: endsWith(matrix.dotnet.tfm, '.0') # only for .NET core |