test(profiling): with address sanitizer on bookworm with GH actions #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Profiling ASAN Tests | |
on: | |
pull_request: | |
jobs: | |
prof-correctness: | |
runs-on: ubuntu-latest | |
container: | |
image: datadog/dd-trace-ci:php-8.3_bookworm-1 | |
options: --user 3434 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Restore build cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-asan-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build profiler | |
run: | | |
set -eux | |
switch-php nts-asan | |
cd profiling | |
export CARGO_TARGET_DIR=/tmp/build-cargo | |
export CC=clang-16 | |
export CFLAGS='-fsanitize=address -fno-omit-frame-pointer' | |
export LDFLAGS='-fsanitize=address' | |
export RUSTC_LINKER=lld-16 | |
triplet=$(uname -m)-unknown-linux-gnu | |
RUSTFLAGS='-Zsanitizer=address' cargo +nightly-2023-05-03 build -Zbuild-std --target $triplet --release | |
cd tests | |
php run-tests.php --asan -d extension=$CARGO_TARGET_DIR/$triplet/release/libdatadog_php_profiling.so phpt | |
- name: Cache build dependencies | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-asan-${{ hashFiles('**/Cargo.lock') }} | |