Skip to content

Commit 3bbbef0

Browse files
author
Jose A. Fernandez
committed
Add CI workflow for .NET projects using GitHub Actions using a matrix strategy on both Ubuntu and Windows runners
1 parent 545d722 commit 3bbbef0

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, develop ]
6+
pull_request:
7+
branches: [ master, develop ]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
include:
15+
- os: ubuntu-latest
16+
dotnet-version: '8.0.x'
17+
test-framework: 'net8.0'
18+
- os: ubuntu-latest
19+
dotnet-version: '9.0.x'
20+
test-framework: 'net9.0'
21+
- os: windows-latest
22+
dotnet-version: '8.0.x'
23+
test-framework: 'net48'
24+
- os: windows-latest
25+
dotnet-version: '8.0.x'
26+
test-framework: 'net481'
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: ${{ matrix.dotnet-version }}
33+
- name: Install dependencies
34+
working-directory: src
35+
run: dotnet restore
36+
- name: Build
37+
working-directory: src
38+
run: dotnet build --configuration Release --no-restore
39+
- name: Test
40+
working-directory: src
41+
run: dotnet test --no-restore --verbosity normal --framework ${{ matrix.test-framework }}

0 commit comments

Comments
 (0)