Skip to content

Commit 971bf84

Browse files
committed
Add GitHub Actions CI
1 parent a62dafb commit 971bf84

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: .NET
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ ubuntu-latest, windows-latest, macos-latest ]
17+
dotnet: [ '2.1.x', '9.0' ]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
id: stepid
24+
with:
25+
dotnet-version: ${{ matrix.dotnet }}
26+
# By default, tests will be executed under the latest installed version!
27+
- name: Create temporary global.json
28+
run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json
29+
- name: Restore packages
30+
run: dotnet restore -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"
31+
- name: Build solution
32+
run: dotnet build --no-restore --configuration Release -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest" --verbosity normal
33+
- name: Run tests
34+
run: dotnet test --configuration Release --no-build --verbosity normal -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"

0 commit comments

Comments
 (0)