-
Notifications
You must be signed in to change notification settings - Fork 764
187 lines (171 loc) · 7.3 KB
/
ci.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
name: Build
on:
pull_request:
branches: [ 'main*' ]
jobs:
lint-misspell-sanitycheck:
uses: ./.github/workflows/sanitycheck.yml
detect-changes:
runs-on: windows-latest
outputs:
changes: ${{ steps.changes.outputs.changes }}
steps:
- uses: AurorNZ/paths-filter@v4
id: changes
with:
filters: |
md: ['**.md']
build: ['build/**', '.github/**/*.yml', '**/*.targets', '**/*.props']
shared: ['src/Shared/**']
code: ['**.cs', '**.csproj', '.editorconfig']
packaged-code: ['src/**', '!**/*.md']
api-code: ['*/OpenTelemetry.Api*/**', '!**/*.md']
api-packages: ['src/OpenTelemetry.Api*/**', '!**/*.md']
instrumentation: ['*/OpenTelemetry.Instrumentation*/**', 'test/TestApp.AspNetCore/**', '!**/*.md']
instrumentation-packages: ['src/OpenTelemetry.Instrumentation*/**', '!**/*.md']
sdk-code: ['src/OpenTelemetry/**', 'test/OpenTelemetry.Tests/**', '!**/*.md']
sdk-package: ['src/OpenTelemetry/**', '!**/*.md']
otlp: ['*/OpenTelemetry.Exporter.OpenTelemetryProtocol*/**', '!**/*.md']
lint-md:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'md')
|| contains(needs.detect-changes.outputs.changes, 'build')
uses: ./.github/workflows/markdownlint.yml
lint-dotnet-format:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'code')
|| contains(needs.detect-changes.outputs.changes, 'build')
uses: ./.github/workflows/dotnet-format.yml
build-test-solution-stable:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: 'OpenTelemetry.sln'
project-build-commands: '-p:ExposeExperimentalFeatures=false'
code-cov-name: 'Solution-Stable'
build-test-solution-experimental:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: 'OpenTelemetry.sln'
project-build-commands: '-p:ExposeExperimentalFeatures=true'
code-cov-name: 'Solution-Experimental'
# Build instrumentation libraries using stable packages released to NuGet
build-test-instrumentation-stable:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'instrumentation-packages')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: './build/InstrumentationLibraries.proj'
project-build-commands: '-p:RunningDotNetPack=true -p:ExposeExperimentalFeatures=false'
code-cov-name: 'Instrumentation-Stable'
# Build instrumentation libraries using stable packages released to NuGet
build-test-instrumentation-experimental:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'instrumentation-packages')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/Component.BuildTest.yml
with:
project-name: './build/InstrumentationLibraries.proj'
project-build-commands: '-p:RunningDotNetPack=true -p:ExposeExperimentalFeatures=true'
code-cov-name: 'Instrumentation-Experimental'
otlp-integration-test:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'api-packages')
|| contains(needs.detect-changes.outputs.changes, 'sdk-package')
|| contains(needs.detect-changes.outputs.changes, 'otlp')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ net6.0, net7.0, net8.0 ]
steps:
- uses: actions/checkout@v4
- name: Run OTLP Exporter docker-compose
run: docker-compose --file=test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
w3c-trace-context-integration-test:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'api-packages')
|| contains(needs.detect-changes.outputs.changes, 'sdk-package')
|| contains(needs.detect-changes.outputs.changes, 'instrumentation')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [ net6.0, net7.0 ]
steps:
- uses: actions/checkout@v4
- name: Run W3C Trace Context docker-compose
run: docker-compose --file=test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
validate-packages:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'packaged-code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/package-validation.yml
generate-docs:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'packaged-code')
|| contains(needs.detect-changes.outputs.changes, 'md')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/docfx.yml
verify-aot-compat:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'packaged-code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/verifyaotcompat.yml
concurrency-tests:
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'api-code')
|| contains(needs.detect-changes.outputs.changes, 'sdk-code')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
uses: ./.github/workflows/concurrency-tests.yml
build-test:
needs: [
lint-misspell-sanitycheck,
detect-changes,
lint-md,
lint-dotnet-format,
build-test-solution-stable,
build-test-solution-experimental,
build-test-instrumentation-stable,
build-test-instrumentation-experimental,
otlp-integration-test,
w3c-trace-context-integration-test,
validate-packages,
generate-docs,
verify-aot-compat,
concurrency-tests
]
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
runs-on: windows-latest
steps:
- run: echo 'build complete'