-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from neosmart/github-ci
Add CI We should refactor the tests project to also run under .NET 2.0/4.0 where possible.
- Loading branch information
Showing
4 changed files
with
47 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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: 'net40' }, | ||
{ os: 'ubuntu', version: '6', tfm: 'net6.0' }, | ||
{ os: 'ubuntu', version: '8', tfm: 'net8.0' }, | ||
] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup .NET | ||
if: endsWith(matrix.dotnet.tfm, '.0') # 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: 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 | ||
if: endsWith(matrix.dotnet.tfm, '.0') # only for .NET core | ||
run: dotnet test -p:Configuration=Release --verbosity normal -p:TargetFrameworks="${{ matrix.dotnet.tfm }}" -p:LangVersion="latest" |
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
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
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