-
Notifications
You must be signed in to change notification settings - Fork 10
255 lines (236 loc) · 9.48 KB
/
test.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
name: Test
on: [push]
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.76.0
jobs:
test:
name: "cargo test --workspace #${{ matrix.platform }} ${{ matrix.rust_version }}"
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [windows-latest, ubuntu-latest, macos-12]
rust_version: [""]
include:
- platform: "ubuntu-latest"
rust_version: "${RUST_VERSION}"
fail-fast: false
steps:
- name: Free Disk Space (Ubuntu only)
if: runner.os == 'Linux' && matrix.platform == 'ubuntu-latest'
uses: jlumbroso/[email protected]
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: ./.github/actions/cache
with:
rust_version: ${{ matrix.rust_version }}
- name: Install Rust ${{ matrix.rust_version }}
if: matrix.rust_version != ''
run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }}
- id: rust-version
# On Windows run happens in a PowerShell, so start bash explicitly
run: bash -c 'echo "version=$(rustc --version)" >> $GITHUB_OUTPUT'
- name: Install Protoc Binary
shell: bash
run: chmod +x ./scripts/install-protoc.sh && ./scripts/install-protoc.sh $HOME
- name: Install cargo nextest
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: "Remove nextest CI report"
shell: bash
run: rm -rf target/nextest/ci/junit.xml
- name: "[${{ steps.rust-version.outputs.version}}] cargo build --workspace --exclude builder --verbose"
shell: bash
run: cargo build --workspace --exclude builder --verbose
- name: "[${{ steps.rust-version.outputs.version}}] cargo nextest run --workspace --exclude builder --profile ci --verbose -E '!test(tracing_integration_tests::)'"
shell: bash
# Run doc tests with cargo test and run tests with nextest and generate junit.xml
run: cargo test --workspace --exclude builder --doc --verbose && cargo nextest run --workspace --exclude builder --profile ci --verbose -E '!test(tracing_integration_tests::)'
env:
RUST_BACKTRACE: 1
- name: "[${{ steps.rust-version.outputs.version}}] Tracing integration tests: cargo nextest run --workspace --exclude builder --profile ci --verbose -E 'test(tracing_integration_tests::)'"
if: runner.os == 'Linux'
shell: bash
run: cargo nextest run --workspace --exclude builder --profile ci --verbose -E 'test(tracing_integration_tests::)'
env:
RUST_BACKTRACE: 1
- name: "[${{ steps.rust-version.outputs.version}}] RUSTFLAGS=\"-C prefer-dynamic\" cargo nextest run --package test_spawn_from_lib --features prefer-dynamic -E '!test(tracing_integration_tests::)'"
shell: bash
run: cargo nextest run --package test_spawn_from_lib --features prefer-dynamic -E '!test(tracing_integration_tests::)'
env:
RUSTFLAGS: "-C prefer-dynamic"
RUST_BACKTRACE: 1
- name: Report Test Results
if: success() || failure()
uses: mikepenz/action-junit-report@v4
with:
report_paths: "target/nextest/ci/junit.xml"
check_name: "[${{ matrix.platform }}:${{ matrix.rust_version }}] test report"
include_passed: true
ffi:
name: "FFI #${{ matrix.platform }} ${{ matrix.rust_version }}"
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [windows-latest, ubuntu-latest, macos-12]
rust_version: [""]
include:
- platform: "ubuntu-latest"
rust_version: "${RUST_VERSION}"
- platform: "ubuntu-latest"
flags: "-C relocation-model=pic"
- platform: "macos-12"
flags: "-C relocation-model=pic"
- platform: "windows-latest"
flags: "-C target-feature=+crt-static"
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup output dir
shell: bash
run: |
WORKSPACE_PATH=${{ github.workspace }}
if [[ "${{ matrix.platform }}" == "windows-latest" ]]; then
WORKSPACE_PATH=$(cygpath -ua '${{ github.workspace }}')
fi
echo "LIBDD_OUTPUT_FOLDER=$WORKSPACE_PATH/artifacts" >> $GITHUB_ENV
- name: Free Disk Space (Ubuntu only)
if: runner.os == 'Linux' && matrix.platform == 'ubuntu-latest'
uses: jlumbroso/[email protected]
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- name: Cache
uses: ./.github/actions/cache
with:
rust_version: ${{ matrix.rust_version }}
build_profile: "release"
- name: Install nightly toolchain
run: rustup install nightly
- name: Install Rust ${{ matrix.rust_version }}
if: matrix.rust_version != ''
run: rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }}
- id: rust-version
# On Windows run happens in a PowerShell, so start bash explicitly
run: bash -c 'echo "version=$(rustc --version)" >> $GITHUB_OUTPUT'
- name: "Generate profiling FFI"
shell: bash
env:
RUSTFLAGS: "${{ matrix.flags }}"
run: |
cargo build -p builder --features profiling,telemetry,data-pipeline,symbolizer,crashtracker --release -vv
- name: 'Publish libdatadog'
uses: actions/upload-artifact@v4
# Only upload the artifacts built with the default Rust version
if: (success() || failure()) && matrix.rust_version == ''
with:
if-no-files-found: error
name: libdatadog.${{ matrix.platform }}
path: ${{ github.workspace }}/artifacts
retention-days: 1
- name: "(Windows) Test building Profiling C bindings - dynamic link vc runtime"
if: matrix.platform == 'windows-latest'
shell: bash
run: |
set -e
rm -rf examples/ffi/build_dll
mkdir examples/ffi/build_dll
cd examples/ffi/build_dll
cmake -S .. -DDatadog_ROOT=$LIBDD_OUTPUT_FOLDER -DVCRUNTIME_LINK_TYPE=DLL
cmake --build .
- name: "(Windows) Test building Profiling C bindings - static link vc runtime"
if: matrix.platform == 'windows-latest'
shell: bash
run: |
set -e
rm -rf examples/ffi/build_static
mkdir examples/ffi/build_static
cd examples/ffi/build_static
cmake -S .. -DDatadog_ROOT=$LIBDD_OUTPUT_FOLDER -DVCRUNTIME_LINK_TYPE=STATIC
cmake --build .
- name: "Test building Profiling C bindings"
shell: bash
if: matrix.platform != 'windows-latest'
run: |
set -e
mkdir examples/ffi/build
cd examples/ffi/build
# Add BUILD_SYMBOLIZER variable only for Linux platforms
if [[ "${{ matrix.platform }}" == "ubuntu-latest" ]]; then
cmake -S .. -DDatadog_ROOT=$LIBDD_OUTPUT_FOLDER -DBUILD_SYMBOLIZER=true
cmake --build .
./symbolizer
else
cmake -S .. -DDatadog_ROOT=$LIBDD_OUTPUT_FOLDER
cmake --build .
fi
cross-centos7:
name: build and test using cross - on centos7
runs-on: ubuntu-latest
concurrency:
group: ci-${{ github.ref }}-cross-centos7
cancel-in-progress: true
steps:
- name: Free Disk Space
uses: jlumbroso/[email protected]
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: true
- name: Checkout
uses: actions/checkout@v4
- name: Cache
uses: ./.github/actions/cache
with:
rust_version: cross-centos7
- run: cargo install cross || true
- run: cross build --workspace --target x86_64-unknown-linux-gnu --exclude builder
- run: cross test --workspace --target x86_64-unknown-linux-gnu --exclude builder -- --skip "::single_threaded_tests::" --skip "tracing_integration_tests::"
- run: cross test --workspace --target x86_64-unknown-linux-gnu --exclude builder --exclude bin_tests -- --skip "::tests::" --skip "::api_tests::" --test-threads 1 --skip "tracing_integration_tests::"
ffi_bake:
strategy:
matrix:
target: [alpine-build] # debian-build-aarch64 is oom killed at the moment
name: "FFI ${{ matrix.target }} via docker bake"
concurrency:
group: ci-${{ github.ref }}-${{ matrix.target }}
cancel-in-progress: true
runs-on:
labels: ubuntu-latest-16-cores
group: APM Larger Runners
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-config: .github/buildkitd-16-cores.toml
-
name: Build and Generate FFI
uses: docker/[email protected]
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,mode=max,scope=${{ matrix.target }}