-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 1.77 KB
/
build-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build and test .NET projects
on:
push:
branches:
- main
- releases/*
create:
branches:
- releases/*
tags:
- releases/*
pull_request:
branches:
- main
jobs:
build:
name: Build ${{ matrix.display-name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
configuration: ['debug', 'release']
include:
- configuration: 'debug'
display-name: 'Debug'
- configuration: 'release'
display-name: 'Release'
steps:
- uses: actions/checkout@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Build
run: find . -name "*.csproj" | xargs -I {} dotnet build "{}" --configuration ${{ matrix.configuration }}
test:
name: Test ${{ matrix.display-name }}
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dotnet-version: ['8.0', '9.0']
include:
- dotnet-version: '8.0'
display-name: '.NET 8.0'
framework: 'net8.0'
install-version: '8.0.x'
- dotnet-version: '9.0'
display-name: '.NET 9.0'
framework: 'net9.0'
install-version: '9.0.x'
steps:
- uses: actions/checkout@v1
- name: Setup ${{ matrix.display-name }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.install-version }}
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
if: ${{ matrix.install-version != '9.0.x' }}
with:
dotnet-version: 9.0.x
- name: Test
id: tests
run: |
find . -name "*.csproj" | xargs -I {} dotnet test "{}" \
--framework ${{ matrix.framework }}