Skip to content

Commit a8e3d8a

Browse files
Merge pull request #37 from MChatzakis/step8
GitHub Actions inital commit
2 parents f09b96a + 01224c4 commit a8e3d8a

4 files changed

Lines changed: 419 additions & 267 deletions

File tree

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main, master, develop]
6+
push:
7+
branches: [main, master, develop]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
build-type: [Release, Debug]
16+
mpi: [ON, OFF] # Enable or disable MPI
17+
cuda: [ON, OFF] # Enable or disable CUDA
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Install system dependencies
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y \
27+
build-essential \
28+
cmake \
29+
libomp-dev \
30+
libopenmpi-dev \
31+
openmpi-bin \
32+
openmpi-common \
33+
libopenmpi-dev
34+
35+
- name: Setup Python
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: "3.12"
39+
40+
- name: Install Python dependencies
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install numpy==2.2.6 mpi4py==4.0.3
44+
45+
- name: Create build directory
46+
run: mkdir build
47+
48+
- name: Configure CMake
49+
run: |
50+
cd build
51+
cmake .. \
52+
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
53+
-DODYSSEY_MPI=${{ matrix.mpi }} \
54+
-DSING_CUDA=${{ matrix.cuda }} \
55+
-DBUILD_PYTHON=ON \
56+
-DBUILD_BENCHMARK=ON \
57+
-DBUILD_DEMO=ON \
58+
-DDEBUG_MSG=ON
59+
60+
- name: Build project
61+
run: |
62+
cd build
63+
make -j$(nproc)
64+
65+
- name: Run tests
66+
run: |
67+
cd build
68+
ctest --output-on-failure --verbose
69+
70+
- name: Run individual test executables (fallback)
71+
if: failure()
72+
run: |
73+
cd build
74+
# List all test executables and run them individually
75+
find . -name "test_*" -type f -executable | while read test_exe; do
76+
echo "Running $test_exe"
77+
if ! $test_exe --gtest_output=xml:${test_exe##*/}_results.xml; then
78+
echo "Test $test_exe failed"
79+
exit 1
80+
fi
81+
done

.github/workflows/simple-ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Simple CI
2+
3+
on:
4+
pull_request:
5+
branches: [main, master, develop]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Install system dependencies
16+
run: |
17+
sudo apt-get update
18+
sudo apt-get install -y \
19+
build-essential \
20+
cmake \
21+
libomp-dev
22+
23+
- name: Setup Python
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: "3.12"
27+
28+
- name: Install basic Python dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install numpy
32+
33+
- name: Create build directory
34+
run: mkdir -p build
35+
36+
- name: Configure CMake (minimal configuration)
37+
run: |
38+
cd build
39+
cmake .. \
40+
-DCMAKE_BUILD_TYPE=Release \
41+
-DODYSSEY_MPI=OFF \
42+
-DSING_CUDA=OFF \
43+
-DBUILD_PYTHON=OFF \
44+
-DBUILD_BENCHMARK=OFF \
45+
-DBUILD_DEMO=OFF
46+
47+
- name: Build project
48+
run: |
49+
cd build
50+
make -j$(nproc)
51+
52+
- name: Run tests
53+
run: |
54+
cd build
55+
ctest --output-on-failure --verbose
56+
57+
- name: List and run test executables directly
58+
if: always()
59+
run: |
60+
cd build/tests
61+
echo "Available test executables:"
62+
ls -la test_* 2>/dev/null || echo "No test executables found"
63+
64+
# Run each test executable if they exist
65+
for test_exe in test_*; do
66+
if [ -x "$test_exe" ]; then
67+
echo "Running $test_exe"
68+
./$test_exe || echo "Test $test_exe failed but continuing..."
69+
fi
70+
done

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ source diNo_env/bin/activate # On Windows: .\diNo_env\Scripts\activate
3131
pip install -r requirements_diNo.txt
3232

3333
# Build the library
34-
mkdir -p build && cd build
34+
mkdir build
35+
cd build
3536
cmake ..
3637
cmake --build .
3738

0 commit comments

Comments
 (0)