Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1003,3 +1003,21 @@ jobs:
|
python ${GITHUB_WORKSPACE}/trace-context/test/test.py http://localhost:30000/test TraceContextTest AdvancedTest
curl http://localhost:30000/stop

verify-examples:
name: Verify Examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Environment for Examples
run: |
sudo apt-get update
sudo -E ./ci/setup_ci_environment.sh
sudo apt-get update && sudo apt-get install -y cmake
- name: Run Examples Verification Script
run: |
chmod +x ci/verify_examples.sh
./ci/verify_examples.sh

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Increment the:

## [Unreleased]

* [CI] Added .sh file to run baselisk and Cmake tests

* [CI] Added verify examples job to CI workflow to run verify_examples.sh

* [SDK] Add tracer scope configurator
[#3137](https://github.com/open-telemetry/opentelemetry-cpp/pull/3137)

Expand Down
29 changes: 29 additions & 0 deletions ci/verify_examples.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash


set -e

echo "Running Bazel tests for examples..."
# Ensure Bazelisk is installed or available
sudo apt-get update
sudo apt-get install -y bazelisk
bazelisk test //examples/...

echo "Running CMake tests for examples..."
sudo apt-get update
sudo apt-get install -y cmake

# Loop over each subdirectory in examples and run CMake tests if a CMakeLists.txt exists.
for d in examples/*/ ; do
if [ -f "$d/CMakeLists.txt" ]; then
echo "Building CMake project in $d"
mkdir -p "$d/build"
pushd "$d/build"
cmake ..
cmake --build .
ctest --output-on-failure
popd
else
echo "Skipping $d as no CMakeLists.txt found."
fi
done
Loading