migrate profiling tests to github actions #1
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 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: ${{ matrix.triplet == 'aarch64' && 'arm-medium' || 'large' }} | |
env: | |
CARGO_TARGET_DIR: /mnt/ramdisk/cargo | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Docker | |
run: | | |
docker pull ${{ matrix.docker_image }} | |
docker run --rm -v $(pwd):/mnt/ramdisk/cargo --name test-container ${{ matrix.docker_image }} | |
- 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 |