-
-
Notifications
You must be signed in to change notification settings - Fork 37
78 lines (66 loc) · 2.39 KB
/
build.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
77
78
name: Build for multiple SDK versions
on:
push:
branches:
- main
pull_request:
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
dotnet-version: ["", "8.0.x", "9.0.x"]
# these entries will mesh with the above combinations
include:
# just use what's in the repo
- global-json-file: "global.json"
dotnet-version: ""
label: "repo global.json"
build_net9: false
globaljson-command: "dotnet new globaljson --sdk-version 8.0.400"
# latest 8.0 stable
- global-json-file: "global.json"
dotnet-version: "8.0.x"
label: "8.0 stable"
build_net9: false
globaljson-command: "dotnet new globaljson --sdk-version 8.0.0 --roll-forward latestMinor"
# latest 9.0 stable
- global-json-file: "global.json"
dotnet-version: "9.0.x"
label: "9.0 stable"
build_net9: true
globaljson-command: "dotnet new globaljson --sdk-version 9.0.0 --roll-forward latestMinor"
fail-fast: false # we have timing issues on some OS, so we want them all to run
runs-on: ${{ matrix.os }}
timeout-minutes: 15
name: Build on ${{matrix.os}} for ${{ matrix.label }}
steps:
- uses: actions/checkout@v3
# setup .NET per the repo global.json
- name: Setup .NET
uses: actions/setup-dotnet@v4
# setup .NET per test session
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: ${{ matrix.global-json-file }}
dotnet-version: ${{ matrix.dotnet-version }}
# remove global.json, create new one to protect against CI machine installed defaults. Then the env configuration takes precedence
- name: Purge global.json
run: |
rm global.json
${{ matrix.globaljson-command }}
# let's make sure we're on the version we think we are.
- name: Announce .NET version
run: dotnet --info
- name: Restore tools
run: dotnet tool restore
- name: Run build and test
run: dotnet run --project build
env:
BuildNet9: ${{ matrix.build_net9 }}
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test/**/TestResults/*.trx