Skip to content

Commit 11503c1

Browse files
committed
Add .NET Build and Test GitHub action
1 parent 2c837a3 commit 11503c1

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
env:
13+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
14+
15+
jobs:
16+
linux:
17+
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
dotnet: [ '6.0.x' ]
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Setup .NET
26+
id: dotnet-version
27+
uses: actions/setup-dotnet@v3
28+
with:
29+
dotnet-version: ${{ matrix.dotnet }}
30+
- name: Create temporary global.json
31+
run: echo '{"sdk":{"version":"${{ steps.dotnet-version.outputs.dotnet-version }}"}}' > ./global.json
32+
- name: Restore dependencies
33+
run: dotnet restore
34+
- name: Build
35+
run: dotnet build --no-restore
36+
- name: Test
37+
run: dotnet test --no-build --verbosity normal
38+
39+
windows:
40+
41+
runs-on: windows-latest
42+
strategy:
43+
matrix:
44+
dotnet: [ '6.0.x' ]
45+
46+
steps:
47+
- uses: actions/checkout@v3
48+
- name: Setup .NET
49+
id: dotnet-version
50+
uses: actions/setup-dotnet@v3
51+
with:
52+
dotnet-version: ${{ matrix.dotnet }}
53+
- name: Create temporary global.json
54+
run: echo '{"sdk":{"version":"${{ steps.dotnet-version.outputs.dotnet-version }}"}}' > ./global.json
55+
- name: Restore dependencies
56+
run: dotnet restore
57+
- name: Build
58+
run: dotnet build --no-restore
59+
- name: Test
60+
run: dotnet test --no-build --verbosity normal

0 commit comments

Comments
 (0)