forked from open-telemetry/opentelemetry-cpp-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (88 loc) · 3.09 KB
/
nginx.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
name: nginx instrumentation CI
on:
push:
branches: "*"
paths:
- 'instrumentation/nginx/**'
- '.github/workflows/nginx.yml'
pull_request:
branches: [ main ]
paths:
- 'instrumentation/nginx/**'
- '.github/workflows/nginx.yml'
jobs:
nginx-build-test:
name: nginx
runs-on: ubuntu-20.04
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-18.04, debian-10.11, debian-11.3]
nginx-rel: [mainline, stable]
steps:
- name: checkout otel nginx
uses: actions/checkout@v3
- name: setup
run: |
sudo ./instrumentation/nginx/ci/setup_environment.sh
- name: generate dockerfile
run: |
cd instrumentation/nginx/test/instrumentation
mix local.hex --force --if-missing
mix local.rebar --force --if-missing
mix deps.get
mix dockerfiles .. ${{ matrix.os }}:${{ matrix.nginx-rel }}
- 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: nginx-${{ matrix.os }}-${{ matrix.nginx-rel }}-${{ github.sha }}
restore-keys: |
nginx-${{ matrix.os }}-${{ matrix.nginx-rel }}
- name: build express backend docker
run: |
cd instrumentation/nginx
docker buildx build -t otel-nginx-test/express-backend \
-f test/backend/simple_express/Dockerfile \
--cache-from type=local,src=/tmp/buildx-cache/express \
--cache-to type=local,dest=/tmp/buildx-cache/express-new \
--load \
test/backend/simple_express
- name: build nginx docker
run: |
cd instrumentation/nginx
docker buildx build -t otel-nginx-test/nginx \
--build-arg image=$(echo ${{ matrix.os }} | sed s/-/:/) \
-f test/Dockerfile.${{ matrix.os }}.${{ matrix.nginx-rel }} \
--cache-from type=local,src=/tmp/buildx-cache/nginx \
--cache-to type=local,dest=/tmp/buildx-cache/nginx-new \
--load \
.
- name: update cache
run: |
rm -rf /tmp/buildx-cache/express
rm -rf /tmp/buildx-cache/nginx
mv /tmp/buildx-cache/express-new /tmp/buildx-cache/express
mv /tmp/buildx-cache/nginx-new /tmp/buildx-cache/nginx
- name: run tests
run: |
cd instrumentation/nginx/test/instrumentation
mix test
- name: copy artifacts
id: artifacts
run: |
cd instrumentation/nginx
mkdir -p /tmp/otel_ngx/
docker buildx build -f test/Dockerfile.${{ matrix.os }}.${{ matrix.nginx-rel}} \
--target export \
--cache-from type=local,src=/tmp/.buildx-cache \
--output type=local,dest=/tmp/otel_ngx .
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: otel_ngx_module-${{ matrix.os }}-${{ matrix.nginx-rel }}.so
path: /tmp/otel_ngx/otel_ngx_module.so