-
Notifications
You must be signed in to change notification settings - Fork 171
Expand file tree
/
Copy pathgenerate-profiler.php
More file actions
85 lines (75 loc) · 3.1 KB
/
generate-profiler.php
File metadata and controls
85 lines (75 loc) · 3.1 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
<?php
include "generate-common.php";
?>
stages:
- test
.all_profiler_targets: &all_profiler_targets
<?php
foreach ($profiler_minor_major_targets as $version) {
echo " - \"{$version}\"\n";
}
?>
"profiling tests":
stage: test
tags: [ "arch:${ARCH}" ]
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:${IMAGE_PREFIX}${PHP_MAJOR_MINOR}${IMAGE_SUFFIX}
variables:
KUBERNETES_CPU_REQUEST: 5
KUBERNETES_MEMORY_REQUEST: 3Gi
KUBERNETES_MEMORY_LIMIT: 4Gi
CARGO_TARGET_DIR: /mnt/ramdisk/cargo # ramdisk??
libdir: /tmp/datadog-profiling
parallel:
matrix:
- PHP_MAJOR_MINOR: *all_profiler_targets
ARCH: *arch_targets
IMAGE_PREFIX: php-compile-extension-alpine-
IMAGE_SUFFIX: [""]
- PHP_MAJOR_MINOR: *all_profiler_targets
ARCH: *arch_targets
IMAGE_PREFIX: php-
IMAGE_SUFFIX: _centos-7
script:
- if [ -d '/opt/rh/devtoolset-7' ]; then set +eo pipefail; source scl_source enable devtoolset-7; set -eo pipefail; fi
- if [ -f /sbin/apk ] && [ $(uname -m) = "aarch64" ]; then ln -sf ../lib/llvm17/bin/clang /usr/bin/clang; fi
- cd profiling
- export TEST_PHP_EXECUTABLE=$(which php)
- run_tests_php=$(find $(php-config --prefix) -name run-tests.php) # don't anticipate there being more than one
- cp -v "${run_tests_php}" tests
- unset DD_SERVICE; unset DD_ENV
- '# NTS'
- command -v switch-php && switch-php "${PHP_MAJOR_MINOR}"
- cargo build --profile profiler-release --all-features
- mkdir -p "${CI_PROJECT_DIR}/artifacts/profiler-tests"
- (cd tests; TEST_PHP_JUNIT="${CI_PROJECT_DIR}/artifacts/profiler-tests/nts-results.xml" php run-tests.php -d "extension=/mnt/ramdisk/cargo/profiler-release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt")
- touch build.rs #make sure `build.rs` gets executed after `switch-php` call
- '# ZTS'
- command -v switch-php && switch-php "${PHP_MAJOR_MINOR}-zts"
- cargo build --profile profiler-release --all-features
- (cd tests; TEST_PHP_JUNIT="${CI_PROJECT_DIR}/artifacts/profiler-tests/zts-results.xml" php run-tests.php -d "extension=/mnt/ramdisk/cargo/profiler-release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt")
after_script:
- .gitlab/upload-junit-to-datadog.sh "test.source.file:profiling"
artifacts:
reports:
junit: "artifacts/profiler-tests/*.xml"
paths:
- "artifacts/"
when: "always"
"clippy NTS":
stage: test
tags: [ "arch:amd64" ]
image: registry.ddbuild.io/images/mirror/datadog/dd-trace-ci:php-${PHP_MAJOR_MINOR}_bookworm-5
variables:
KUBERNETES_CPU_REQUEST: 5
KUBERNETES_MEMORY_REQUEST: 3Gi
KUBERNETES_MEMORY_LIMIT: 4Gi
# CARGO_TARGET_DIR: /mnt/ramdisk/cargo # ramdisk??
libdir: /tmp/datadog-profiling
parallel:
matrix:
- PHP_MAJOR_MINOR: *all_profiler_targets
script:
- switch-php nts # not compatible with debug
- cd profiling
- sed -i -e "s/crate-type.*$/crate-type = [\"rlib\"]/g" Cargo.toml
- cargo clippy --all-targets --all-features -- -D warnings -Aunknown-lints