-
Notifications
You must be signed in to change notification settings - Fork 148
195 lines (187 loc) · 7.43 KB
/
webserver.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
188
189
190
191
192
193
194
name: webserver instrumentation CI
on:
push:
branches: [ main ]
paths:
- 'instrumentation/otel-webserver-module/**'
- '.github/workflows/webserver.yml'
pull_request:
branches: [ main, webserver-dev ]
paths:
- 'instrumentation/otel-webserver-module/**'
- '.github/workflows/webserver.yml'
jobs:
webserver-build-test-ubuntu:
name: webserver-ubuntu-build
runs-on: ubuntu-20.04
steps:
- name: checkout otel webserver
uses: actions/checkout@v3
- name: setup buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
install: true
- name: cache docker layers
uses: actions/cache@v3
with:
path: /tmp/buildx-cache/
key: apache-ubuntu-20.04-${{ github.sha }}
restore-keys: |
apache-ubuntu-20.04
- name: setup docker image
run: |
cd instrumentation/otel-webserver-module
docker buildx build -t apache_ubuntu -f docker/ubuntu20.04/Dockerfile \
--cache-from type=local,src=/tmp/buildx-cache/apache_ubuntu \
--cache-to type=local,dest=/tmp/buildx-cache/apache_ubuntu-new \
--load .
- name: build
run: |
docker run -idt --name apache_ubuntu_container apache_ubuntu /bin/bash
cd instrumentation/otel-webserver-module
docker exec apache_ubuntu_container bash -c \
'cd /otel-webserver-module; rm -rf *;'
docker cp . $(docker inspect --format="{{.Id}}" apache_ubuntu_container):/otel-webserver-module/
docker exec apache_ubuntu_container bash -c \
'cd /otel-webserver-module; rm -rf build; \
cp -r /dependencies /otel-webserver-module/; \
cp -r /build-dependencies /otel-webserver-module/; \
./gradlew assembleWebServerModule -DtargetSystem=ubuntu'
- name: update cache
run: |
rm -rf /tmp/buildx-cache/apache_ubuntu
mv /tmp/buildx-cache/apache_ubuntu-new /tmp/buildx-cache/apache_ubuntu
webserver-build-test-centos7:
name: webserver-centos7-build
runs-on: ubuntu-20.04
steps:
- name: checkout otel webserver
uses: actions/checkout@v3
- name: setup buildx
id: buildx
uses: docker/setup-buildx-action@master
with:
install: true
- name: cache docker layers
uses: actions/cache@v3
with:
path: /tmp/buildx-cache/
key: apache-centos7-${{ github.sha }}
restore-keys: |
apache-centos7
- name: setup docker image
run: |
cd instrumentation/otel-webserver-module
docker buildx build -t apache_centos7 -f docker/centos7/Dockerfile \
--cache-from type=local,src=/tmp/buildx-cache/apache_centos7 \
--cache-to type=local,dest=/tmp/buildx-cache/apache_centos7-new \
--load .
- name: build
run: |
docker run -idt --name apache_centos7_container apache_centos7 /bin/bash
cd instrumentation/otel-webserver-module
docker exec apache_centos7_container bash -c \
'cd /otel-webserver-module; rm -rf *;'
docker cp . $(docker inspect --format="{{.Id}}" apache_centos7_container):/otel-webserver-module/
docker exec apache_centos7_container bash -c \
'cd /otel-webserver-module; rm -rf build; \
cp -r /dependencies /otel-webserver-module/; \
cp -r /build-dependencies /otel-webserver-module/; \
./gradlew assembleWebServerModule'
- name: unit test
run: |
docker exec apache_centos7_container bash -c \
'cd /otel-webserver-module; ./gradlew runUnitTest'
- name: update cache
run: |
rm -rf /tmp/buildx-cache/apache_centos7
mv /tmp/buildx-cache/apache_centos7-new /tmp/buildx-cache/apache_centos7
- name: copy artifacts
id: artifacts
run: |
cd instrumentation/otel-webserver-module
mkdir -p /tmp/apache_centos7/
docker cp apache_centos7_container:/otel-webserver-module/build/opentelemetry-webserver-sdk-x64-linux.tgz \
/tmp/apache_centos7/
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: opentelemetry-webserver-sdk-x64-linux.tgz
path: /tmp/apache_centos7/opentelemetry-webserver-sdk-x64-linux.tgz
- name: run integrationtest
run: |
docker rm -f apache_centos7_container
cd instrumentation/otel-webserver-module
docker-compose --profile centos7 up -d
docker ps -a
sleep 30
./gradlew :test:integration:integrationTests -i
webserver-build-test-centos6:
name: webserver-centos6-build
runs-on: ubuntu-20.04
steps:
# - name: checkout otel webserver
# uses: actions/checkout@v3
# - name: setup buildx
# id: buildx
# uses: docker/setup-buildx-action@master
# with:
# install: true
# - name: cache docker layers
# uses: actions/cache@v3
# with:
# path: /tmp/buildx-cache/
# key: apache-centos6-${{ github.sha }}
# restore-keys: |
# apache-centos6
# - name: setup docker image
# run: |
# cd instrumentation/otel-webserver-module
# docker buildx build -t apache_centos6 -f Dockerfile \
# --cache-from type=local,src=/tmp/buildx-cache/apache_centos6 \
# --cache-to type=local,dest=/tmp/buildx-cache/apache_centos6-new \
# --load .
# - name: build
# run: |
# docker run -idt --name apache_centos6_container apache_centos6 /bin/bash
# cd instrumentation/otel-webserver-module
# docker exec apache_centos6_container bash -c \
# 'cd /otel-webserver-module; rm -rf *;'
# docker cp . $(docker inspect --format="{{.Id}}" apache_centos6_container):/otel-webserver-module/
# docker exec apache_centos6_container bash -c \
# 'cd /otel-webserver-module; rm -rf build; \
# cp -r /dependencies /otel-webserver-module/; \
# cp -r /build-dependencies /otel-webserver-module/; \
# ./gradlew assembleWebServerModule'
# - name: unit test
# run: |
# docker exec apache_centos6_container bash -c \
# 'cd /otel-webserver-module; ./gradlew runUnitTest'
- name: update cache
run: |
rm -rf /tmp/buildx-cache/apache_centos6
# mv /tmp/buildx-cache/apache_centos6-new /tmp/buildx-cache/apache_centos6
Codeql-build:
name: static-analysis
runs-on: ubuntu-20.04
steps:
- name: checkout otel webserver
uses: actions/checkout@v3
- name: setup environment
run: |
cd ..
cp opentelemetry-cpp-contrib/instrumentation/otel-webserver-module/codeql-env.sh .
sudo ./codeql-env.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: build
run: |
cd instrumentation/otel-webserver-module
cp -r /dependencies ../otel-webserver-module/
cp -r /build-dependencies ../otel-webserver-module/
./gradlew assembleWebserverModule -DtargetSystem=ubuntu --info
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2