-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (73 loc) · 3.09 KB
/
dev.yml
File metadata and controls
76 lines (73 loc) · 3.09 KB
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
name: Development
on:
push:
workflow_dispatch:
schedule:
# Run every other month to avoid 90-day GitHub artifact expiration
- cron: '0 0 1 */2 *'
jobs:
format:
runs-on: ubuntu-22.04
container:
image: datadog/docker-library:dd-trace-cpp-ci
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- run: ./scripts/codestyle.sh lint
build:
needs: format
runs-on: ubuntu-22.04
container:
# See in Makefile where this image comes from.
image: datadog/docker-library:httpd-datadog-ci-28219c0ef3e00f1e3d5afcab61a73a5e9bd2a9b957d7545556711cce2a6262cd
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Add cloned repo as safe
run: sh -c "git config --global --add safe.directory $PWD"
- name: Init required submodules
run: git submodule update --init --depth=1 deps/dd-trace-cpp deps/nginx-datadog
- name: Configure
run: cmake --preset=ci-dev -B build .
- name: Build
run: |
cmake --build build -j --verbose
cmake --install build --prefix dist
- name: Export library
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: mod_datadog_artifact
path: dist/lib/mod_datadog.so
if-no-files-found: error
test:
needs: build
runs-on: ubuntu-22.04
container:
# See in Makefile where this image comes from.
image: datadog/docker-library:httpd-datadog-ci-28219c0ef3e00f1e3d5afcab61a73a5e9bd2a9b957d7545556711cce2a6262cd
env:
DD_ENV: ci
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_APP }}
DD_SERVICE: httpd-tests
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
LLVM_PROFILE_FILE: /tmp/httpd.%p-%m.profraw
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- run: |
pip install -r requirements.txt --break-system-packages
pip install ddtrace --break-system-packages
- name: Import library from build job
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: mod_datadog_artifact
path: dist/lib
- name: Run Smoke Tests
run: pytest --ddtrace test/integration-test --module-path dist/lib/mod_datadog.so --bin-path /httpd/httpd-build/bin/apachectl --log-dir $(pwd)/logs -m smoke
- name: Run Integration Tests
run: pytest --ddtrace test/integration-test --module-path dist/lib/mod_datadog.so --bin-path /httpd/httpd-build/bin/apachectl --log-dir $(pwd)/logs -m ci
- name: Generate code coverage
run: |
llvm-profdata merge -sparse /tmp/*.profraw -o /tmp/default.profdata
llvm-cov export dist/lib/mod_datadog.so -format=lcov -instr-profile=/tmp/default.profdata -ignore-filename-regex=/httpd/ > coverage.lcov
- name: Upload code coverage report to Datadog
run: npx @datadog/datadog-ci@latest coverage upload --format=lcov coverage.lcov
env:
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_APP }}