This repository has been archived by the owner on Jun 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 75
108 lines (102 loc) · 2.97 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: build
on:
push:
branches: [ '*' ]
pull_request:
types: [opened, synchronize, reopened]
env:
DOTNET_NOLOGO: true
defaults:
run:
shell: bash
jobs:
dotnet-format:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
- name: ⚙ dotnet 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: 🙏 restore
run: dotnet restore
- name: ✓ ensure format
run: |
dotnet tool update -g dotnet-format --version 5.0.* --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
dotnet format --check -v:diag
build:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: dotnet-format
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
- name: ⚙ dotnet 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: 🙏 build
run: dotnet msbuild -r -m:1 -bl:build.binlog -p:versionsuffix="$GITHUB_REF.$GITHUB_RUN_NUMBER"
- name: 🧪 test net5.0
run: dotnet test --no-build -f net5.0
- name: 🧪 test net472
run: dotnet test --no-build
if: matrix.os == 'windows-latest'
- name: 🔼 logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: |
*.binlog
**/coverage.cobertura.xml
- name: 🔼 packages
uses: actions/upload-artifact@v2
with:
name: bin
path: bin/*.nupkg
acceptance:
name: acceptance-${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
- name: 🔽 packages
uses: actions/download-artifact@v2
with:
name: bin
path: bin
- name: ⚙ dotnet 5.0.x
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: 🧪 test
run: dotnet test -m:1 -p:versionsuffix="$GITHUB_REF.$GITHUB_RUN_NUMBER"
working-directory: src/Acceptance
push:
name: push nuget.ci
runs-on: ubuntu-latest
needs: [build, acceptance]
steps:
- name: 🔽 packages
uses: actions/download-artifact@v2
with:
name: bin
path: bin
- name: ⚙ dotnet 2.1.x
uses: actions/setup-dotnet@v1
if: matrix.os == 'ubuntu-latest'
with:
dotnet-version: 2.1.x
- name: 🚀 sleet
run: |
dotnet tool install -g --version 3.2.0 sleet
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure"