-
Notifications
You must be signed in to change notification settings - Fork 15
216 lines (208 loc) · 8.07 KB
/
dev.yml
File metadata and controls
216 lines (208 loc) · 8.07 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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: "Development"
on: [pull_request, workflow_dispatch, workflow_call]
jobs:
verify:
runs-on: ubuntu-22.04-arm
container:
image: datadog/docker-library:dd-trace-cpp-ci-23768e9-arm64
env:
BUILD_DIR: .build
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Check format
run: bin/check-format
- name: Shellcheck
run: find bin/ -executable -type f -print0 | xargs -0 shellcheck
- name: Verify getenv usage
run: bin/check-environment-variables
- name: Configure
run: bin/with-toolchain llvm cmake . -B ${BUILD_DIR} --preset ci-clang
- name: Build
run: cmake --build ${BUILD_DIR} -j --target config-inversion -v
- name: Verify supported configurations metadata
run: |
tmp_dir="$(mktemp -d)"
trap 'rm -rf "$tmp_dir"' EXIT
./${BUILD_DIR}/tools/config-inversion/config-inversion --output-file "${tmp_dir}/ci-supported-configurations.json"
if ! diff -q "$tmp_dir/ci-supported-configurations.json" "supported-configurations.json" >/dev/null 2>&1; then
echo "ERROR: supported-configurations.json got out of sync with implemented configurations. Please run `./config-inversion --output-file supported-configurations.json` locally."
diff -u "$tmp_dir/supported-configurations.json" supported-configurations.json || true
exit 1
fi
build-linux-cmake:
strategy:
fail-fast: false
matrix:
toolchain: ["gnu", "llvm"]
arch: ["arm64", "x64"]
include:
- runner: ubuntu-22.04-arm
arch: arm64
docker-arch: arm64
- runner: ubuntu-22.04
arch: x64
docker-arch: amd64
needs: verify
runs-on: ${{ matrix.runner }}
container:
image: datadog/docker-library:dd-trace-cpp-ci-23768e9-${{matrix.docker-arch}}
environment:
name: dev
permissions:
contents: read
packages: read
env:
BUILD_DIR: .build
DD_API_KEY: ${{ secrets.DD_CI_VIS_API_KEY }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Configure
run: bin/with-toolchain ${{ matrix.toolchain }} cmake . -B .build --preset ci-clang
- name: Build
run: cmake --build ${BUILD_DIR} -j -v
- name: Test
run: cd ${BUILD_DIR} && test/tests -r junit -o report.xml
env:
ASAN_OPTIONS: alloc_dealloc_mismatch=0
- name: Upload test report to Datadog
run: |
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-${{ matrix.arch }}" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
datadog-ci junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp .build/report.xml
build-linux-bazel:
needs: verify
strategy:
fail-fast: false
matrix:
toolchain: ["gnu", "llvm"]
arch: ["arm64", "x64"]
bazelrc: [".bazelrc.absl", ".bazelrc.std"]
include:
- runner: ubuntu-22.04-arm
arch: arm64
docker-arch: arm64
- runner: ubuntu-22.04
arch: x64
docker-arch: amd64
runs-on: ${{ matrix.runner }}
container:
image: datadog/docker-library:dd-trace-cpp-ci-23768e9-${{matrix.docker-arch}}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Build
run: bin/with-toolchain ${{ matrix.toolchain }} bazelisk --bazelrc=${{ matrix.bazelrc }} build dd_trace_cpp
build-windows-bazel:
needs: verify
runs-on: windows-2022
defaults:
run:
shell: powershell
strategy:
matrix:
bazelrc: [".bazelrc.absl", ".bazelrc.std"]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Dependency Manager (scoop)
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH
- name: Install Dependencies
run: scoop install main/cmake@4.0.1 main/ninja main/bazelisk
- name: Build
run: bazelisk.exe --bazelrc=${{ matrix.bazelrc }} build dd_trace_cpp
build-windows-cmake:
needs: verify
strategy:
fail-fast: false
matrix:
arch: ["arm64", "amd64"]
include:
- runner: windows-11-arm
arch: arm64
- runner: windows-2022
arch: amd64
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: powershell
environment:
name: dev
permissions:
contents: read
packages: read
env:
DD_API_KEY: ${{ secrets.DD_CI_VIS_API_KEY }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Install Dependency Manager (scoop)
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Join-Path (Resolve-Path ~).Path "scoop\shims" >> $Env:GITHUB_PATH
- name: Install Dependencies
run: scoop install main/cmake@4.0.1 main/ninja
- name: Build
run: |
& 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }}
cmake --preset=ci-msvc -B build -DCMAKE_BUILD_TYPE=Debug .
cmake --build build -j $env:MAKE_JOB_COUNT -v
- name: Test
run: |
& 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }}
.\build\test\tests.exe -r junit -o report.xml
- name: Upload test report to Datadog
run: |
Invoke-WebRequest -Uri "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_win-x64" -OutFile "datadog-ci.exe"
./datadog-ci.exe junit upload --service dd-trace-cpp --tags test.source.file:test/*.cpp report.xml
coverage:
needs: build-linux-cmake
runs-on: ubuntu-22.04-arm
container:
image: datadog/docker-library:dd-trace-cpp-ci-23768e9-arm64
environment:
name: dev
permissions:
contents: read
packages: read
env:
DD_API_KEY: ${{ secrets.DD_CI_VIS_API_KEY }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- run: bin/test --coverage --verbose
- name: Report Datadog coverage
run: |
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-arm64" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
cd .coverage
cp filtered.info lcov.info
datadog-ci coverage upload lcov.info
- uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
fail_ci_if_error: true
files: .coverage/filtered.info
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
build-system-tests-artifact:
runs-on: ubuntu-22.04
steps:
- run: mkdir binaries
- run: echo "https://github.com/DataDog/dd-trace-cpp@${{ github.head_ref || github.ref_name }}" > binaries/cpp-load-from-git
- name: Save artifact
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: system_tests_binaries
path: ./binaries/**/*
system-tests:
needs: build-system-tests-artifact
uses: DataDog/system-tests/.github/workflows/system-tests.yml@main
secrets:
TEST_OPTIMIZATION_API_KEY: ${{ secrets.DD_CI_VIS_API_KEY }}
permissions:
contents: read
packages: write
with:
library: cpp
binaries_artifact: system_tests_binaries
parametric_job_count: 8 # dedicated parameter to speed up parametric job
scenarios: PARAMETRIC
push_to_test_optimization: true