Skip to content

Workflow file for this run

name: Test
on: [push]
env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.69.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}"
steps:
- name: Checkout sources
uses: actions/checkout@v3
- 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
run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
- name: "[${{ steps.rust-version.outputs.version}}] cargo build --workspace --verbose"
run: cargo build --workspace --verbose
- name: "[${{ steps.rust-version.outputs.version}}] cargo test --workspace --verbose"
run: cargo test --workspace --verbose
env:
RUST_BACKTRACE: 1
- name: "[${{ steps.rust-version.outputs.version}}] cargo test --workspace --verbose -- --ignored --test-threads=1"
run: cargo test --workspace --verbose -- --ignored --test-threads=1
env:
RUST_BACKTRACE: 1
- name: "[${{ steps.rust-version.outputs.version}}] RUSTFLAGS=\"-C prefer-dynamic\" cargo test --package test_spawn_from_lib --features prefer-dynamic -- --ignored"
run: cargo test --package test_spawn_from_lib --features prefer-dynamic -- --ignored
env:
RUSTFLAGS: "-C prefer-dynamic"
RUST_BACKTRACE: 1
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}"
steps:
- name: Checkout sources
uses: actions/checkout@v3
- 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 "OUTPUT_FOLDER=$WORKSPACE_PATH/artifacts" >> $GITHUB_ENV
- 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
run: echo "version=$(rustc --version)" >> $GITHUB_OUTPUT
- name: "Generate profiling FFI"
shell: bash
run: |
chmod +x build-profiling-ffi.sh
./build-profiling-ffi.sh ${OUTPUT_FOLDER}/profiling
- name: "Generate Telemetry FFI"
shell: bash
run: |
chmod +x build-profiling-ffi.sh
./build-profiling-ffi.sh ${OUTPUT_FOLDER}/telemetry
- name: 'Publish libdatadog'
uses: actions/upload-artifact@v3
if: '${{ always() }}'
with:
if-no-files-found: error
name: libdatadog.${{ matrix.platform }}
path: ${{ github.workspace }}/artifacts
retention-days: 1
- name: "Test building C bindings"
shell: bash
run: |
mkdir examples/ffi/build
cd examples/ffi/build
cmake -S .. -DDatadog_ROOT=$OUTPUT_FOLDER/profiling
cmake --build .
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: Checkout
uses: actions/checkout@v3
- name: Cache
uses: ./.github/actions/cache
with:
rust_version: cross-centos7
- run: cargo install cross || true
- run: cross build --all
- run: cross test --all
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@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
config: .github/buildkitd-16-cores.toml
-
name: Build and Generate FFI
uses: docker/bake-action@v2
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,mode=max,scope=${{ matrix.target }}