Skip to content

Commit 98e9a74

Browse files
committed
feat: create initial workflow
1 parent f8d96fa commit 98e9a74

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/verify-examples.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: verify examples workflow
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
bazel-tests:
11+
name: Bazel Tests
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v3
16+
17+
- name: Install Bazel
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y bazel
21+
22+
- name: Run Bazel tests
23+
run: |
24+
# Assumes BUILD files are configured under examples/
25+
bazel test //examples/...
26+
27+
cmake-tests:
28+
name: CMake Tests
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout Code
32+
uses: actions/checkout@v3
33+
34+
- name: Install CMake
35+
run: |
36+
sudo apt-get update
37+
sudo apt-get install -y cmake
38+
39+
- name: Build and Test CMake Examples
40+
run: |
41+
# Loop over all immediate subdirectories under examples/
42+
for d in examples/*/ ; do
43+
if [ -f "$d/CMakeLists.txt" ]; then
44+
echo "Building CMake project in $d"
45+
mkdir -p "$d/build"
46+
pushd "$d/build"
47+
cmake ..
48+
cmake --build .
49+
ctest --output-on-failure || exit 1
50+
popd
51+
else
52+
echo "Skipping $d as no CMakeLists.txt found."
53+
fi
54+
done

0 commit comments

Comments
 (0)