-
Notifications
You must be signed in to change notification settings - Fork 292
94 lines (90 loc) · 2.91 KB
/
buildtest.yaml
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
name: Build and Test
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
name: Dotnet build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
# - name: Check Format
# # don't check formatting on Windows b/c of CRLF issues.
# if: matrix.os == 'ubuntu-latest'
# run: dotnet format --severity error --verify-no-changes --exclude ./src/KubernetesClient/generated/
- name: Build
run: dotnet build --configuration Release -v detailed
- name: Test
run: dotnet test --configuration Release --collect:"Code Coverage;Format=Cobertura" --logger trx --results-directory TestResults --settings CodeCoverage.runsettings --no-build
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
directory: ./TestResults
files: '*.cobertura.xml'
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: ./TestResults
if: ${{ always() }} # Always run this step even on failure
# Test code gen for visual studio compatibility >> https://github.com/kubernetes-client/csharp/pull/1008
codgen:
runs-on: windows-latest
name: MSBuild build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Setup dotnet SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore nugets (msbuild)
run: msbuild .\src\KubernetesClient\ -t:restore -p:RestorePackagesConfig=true
- name: Build (msbuild)
run: msbuild .\src\KubernetesClient\
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x
- name: Minikube
run: minikube start
- name: Test
run: |
true > skip.log
env K8S_E2E_MINIKUBE=1 dotnet test tests/E2E.Tests --logger "SkipTestLogger;file=$PWD/skip.log"
if [ -s skip.log ]; then
cat skip.log
echo "CASES MUST NOT BE SKIPPED"
exit 1
fi
- name: AOT Test
run: |
true > skip.log
env K8S_E2E_MINIKUBE=1 dotnet test tests/E2E.Aot.Tests --logger "SkipTestLogger;file=$PWD/skip.log"
if [ -s skip.log ]; then
cat skip.log
echo "CASES MUST NOT BE SKIPPED"
exit 1
fi
on:
pull_request:
types: [assigned, opened, synchronize, reopened]