-
Notifications
You must be signed in to change notification settings - Fork 210
108 lines (102 loc) · 3.16 KB
/
dotnet.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: .NET
on:
workflow_dispatch:
push:
branches: [main]
paths-ignore:
[
"abstractions/**",
"authentication/**",
"serialization/**",
"http/**",
"**.md",
".vscode/**",
"**.svg",
]
pull_request:
paths-ignore:
[
"abstractions/**",
"authentication/**",
"serialization/**",
"http/**",
"**.md",
".vscode/**",
"**.svg",
]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Check formatting
run: dotnet format --verify-no-changes
- name: Build
run: dotnet build kiota.sln --no-restore
- name: Test
run: dotnet test kiota.sln --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Install report generator
run: dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Generate coverage report
run: reportgenerator -reports:**/coverage.cobertura.xml -targetdir:./reports/coverage
- uses: actions/upload-artifact@v3
with:
name: coverage
path: reports/coverage
test-release:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Publish ${{ matrix.os }}
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -o ./${{ matrix.os }}
# Mac and Linux
- name: Isolate the binary
if: runner.os != 'Windows'
run: |
mkdir ./${{ matrix.os }}-standalone
cp ./${{ matrix.os }}/kiota ./${{ matrix.os }}-standalone/kiota
- name: Check the built in default settings
if: runner.os != 'Windows'
run: |
INFO_RESULT=$(./${{ matrix.os }}-standalone/kiota info -l Java)
if [[ $INFO_RESULT == *"maturity level"* ]]; then
echo "Built in defaults are working"
else
echo "Built in defaults NOT working"
./${{ matrix.os }}/kiota info -l Java
exit 1
fi
# Win
- name: Isolate the binary
if: runner.os == 'Windows'
run: |
mkdir ./${{ matrix.os }}-standalone
cp ./${{ matrix.os }}/kiota.exe ./${{ matrix.os }}-standalone/kiota.exe
- name: Check the built in default settings
if: runner.os == 'Windows'
shell: bash
run: |
INFO_RESULT=$(./${{ matrix.os }}-standalone/kiota.exe info -l Java)
if [[ $INFO_RESULT == *"maturity level"* ]]; then
echo "Built in defaults are working"
else
echo "Built in defaults NOT working"
./${{ matrix.os }}/kiota info -l Java
exit 1
fi