Skip to content

migrate profiling tests to github actions #3

migrate profiling tests to github actions

migrate profiling tests to github actions #3

Workflow file for this run

name: Profiling Tests
on:
push:
branches:
- main
pull_request:
jobs:
profiling-tests:
strategy:
matrix:
docker_image:
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.1"
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.2"
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.3"
- "datadog/dd-trace-ci:php-compile-extension-alpine-7.4"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.0"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.1"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.2"
- "datadog/dd-trace-ci:php-compile-extension-alpine-8.3"
- "datadog/dd-trace-ci:php-7.1_centos-7"
- "datadog/dd-trace-ci:php-7.2_centos-7"
- "datadog/dd-trace-ci:php-7.3_centos-7"
- "datadog/dd-trace-ci:php-7.4_centos-7"
- "datadog/dd-trace-ci:php-8.0_centos-7"
- "datadog/dd-trace-ci:php-8.1_centos-7"
- "datadog/dd-trace-ci:php-8.2_centos-7"
- "datadog/dd-trace-ci:php-8.3_centos-7"
triplet:
- "x86_64-alpine-linux-musl"
- "aarch64-alpine-linux-musl"
- "x86_64-unknown-linux-gnu"
- "aarch64-unknown-linux-gnu"
runs-on: ${{ startsWith(matrix.triplet, 'aarch64') && 'arm-8core-linux' || 'ubuntu-latest' }}
container:
image: ${{ matrix.docker_image }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Restore Cargo Package Cache
id: cache
uses: actions/cache@v2
with:
path: /mnt/ramdisk/cargo
key: cargo-cache-${{ matrix.triplet }}-${{ hashFiles('Cargo.lock') }}
- name: Run cargo tests
run: |
if [ -d '/opt/rh/devtoolset-7' ] ; then
set +eo pipefail
source scl_source enable devtoolset-7
set -eo pipefail
fi
set -u
command -v switch-php && switch-php "${PHP_VERSION}"
cd profiling
cargo test --release --all-features
- name: Run phpt tests NTS
run: |
set -u
command -v switch-php && switch-php "${PHP_VERSION}"
set -e
libdir="/tmp/datadog-profiling"
cd profiling
cargo build --release --all-features
cd tests
run_tests_php=$(find $(php-config --prefix) -name run-tests.php)
cp -v "${run_tests_php}" .
export TEST_PHP_EXECUTABLE=$(which php)
php run-tests.php -d "extension=/mnt/ramdisk/cargo/release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt"
- name: Run phpt tests ZTS
run: |
set -u
command -v switch-php && switch-php "${PHP_VERSION}-zts"
set -e
libdir="/tmp/datadog-profiling"
cd profiling
touch build.rs
cargo build --release --all-features
cd tests
run_tests_php=$(find $(php-config --prefix) -name run-tests.php)
cp -v "${run_tests_php}" .
export TEST_PHP_EXECUTABLE=$(which php)
php run-tests.php -d "extension=/mnt/ramdisk/cargo/release/libdatadog_php_profiling.so" --show-diff -g "FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP" "phpt"
- name: Run clippy NTS (for select platforms)
if: matrix.triplet == 'x86_64-unknown-linux-gnu'
run: |
set -u
command -v switch-php && switch-php "${PHP_VERSION}"
set -e
cd profiling
touch build.rs
sed -i -e "s/crate-type.*$/crate-type = [\"rlib\"]/g" Cargo.toml
cargo clippy --all-targets --all-features -- -D warnings -Aunknown-lints