-
-
Notifications
You must be signed in to change notification settings - Fork 37
88 lines (75 loc) · 2.71 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
79
80
81
82
83
84
85
86
87
88
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: ["", "6.0.x", "7.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: ""
include-prerelease: false
label: "repo global.json"
build_net7: false
globaljson-command: "dotnet new globaljson --sdk-version 6.0.400"
# latest 6.0 stable
- global-json-file: "global.json"
dotnet-version: "6.0.x"
include-prerelease: false
label: "6.0 stable"
build_net7: false
globaljson-command: "dotnet new globaljson --sdk-version 6.0.0 --roll-forward latestMinor"
# latest 7.0 preview
- global-json-file: "global.json"
dotnet-version: "7.0.x"
include-prerelease: true
label: "7.0 preview"
build_net7: true
globaljson-command: "dotnet new globaljson --sdk-version 7.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@v2
# setup .NET per test session
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
include-prerelease: ${{ matrix.include-prerelease }}
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:
BuildNet7: ${{ matrix.build_net7 }}
- name: Upload NuGet packages
uses: actions/upload-artifact@v2
with:
name: packages
path: src/**/*.nupkg
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: test/**/TestResults/*.trx