DISCLAIMER CHANGED #117
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| branches: [main, master, develop] | |
| push: | |
| branches: [main, master, develop] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| build-type: [Release, Debug] | |
| # mpi: [ON, OFF] # Enable or disable MPI (COMMENTED OUT) | |
| # cuda: [ON, OFF] # Enable or disable CUDA (COMMENTED OUT) | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Initialize submodules (fallback) | |
| run: | | |
| git submodule update --init --recursive | |
| - name: Verify pybind11 submodule | |
| run: | | |
| ls -la extern/pybind11/CMakeLists.txt || echo "pybind11 CMakeLists.txt not found" | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| libomp-dev \ | |
| libopenblas-dev \ | |
| libopenmpi-dev \ | |
| openmpi-bin \ | |
| openmpi-common | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install numpy==2.2.6 mpi4py==4.0.3 | |
| - name: Create build directory | |
| run: mkdir build | |
| - name: Configure CMake | |
| run: | | |
| cd build | |
| cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DBUILD_ODYSSEY=ON -DBUILD_SING=OFF -DBUILD_PYTHON=ON -DBUILD_BENCHMARK=ON -DBUILD_DEMO=ON -DBUILD_TESTS=ON -DDEBUG_MSG=ON | |
| - name: Build project | |
| run: | | |
| cd build | |
| make -j$(nproc) | |
| - name: Run tests | |
| run: | | |
| cd build | |
| # Run parameterized tests (AstronomyData, RandomWalkData) and Odyssey test | |
| #ctest -R "AstronomyData|RandomWalkData|test_Odyssey_L2Square" --output-on-failure --verbose | |
| ctest -R "AstronomyData " --output-on-failure --verbose | |
| - name: Run individual test executables (fallback) | |
| if: failure() | |
| run: | | |
| cd build | |
| # Run non-Odyssey test executables with AstronomyData filter | |
| for test_exe in $(find . -name "test_*" -type f -executable ! -name "*Odyssey*"); do | |
| echo "Running $test_exe (Astronomy only)" | |
| if ! $test_exe --gtest_filter="*AstronomyData*" --gtest_output=xml:${test_exe##*/}_results.xml; then | |
| echo "Test $test_exe failed" | |
| exit 1 | |
| fi | |
| done | |
| # Run Odyssey test under mpirun if present | |
| if [ -f ./tests/test_Odyssey_L2Square ]; then | |
| echo "Running test_Odyssey_L2Square under mpirun (--oversubscribe for limited cores)" | |
| if ! mpirun --oversubscribe -np 4 ./tests/test_Odyssey_L2Square --gtest_filter="*AstronomyData*"; then | |
| echo "test_Odyssey_L2Square failed" | |
| exit 1 | |
| fi | |
| fi | |