From d3941d3e60e35db7465c9af2625ca722c2c0ce61 Mon Sep 17 00:00:00 2001 From: ViNN280801 Date: Tue, 5 Nov 2024 14:48:01 +0300 Subject: [PATCH] Add CI workflows for multiple platforms and configurations --- .github/workflows/cuda.yml | 40 ++++++++++++++++++++++++++ .github/workflows/fedora.yml | 35 ++++++++++++++++++++++ .github/workflows/ubuntu.yml | 56 ++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 .github/workflows/cuda.yml create mode 100644 .github/workflows/fedora.yml create mode 100644 .github/workflows/ubuntu.yml diff --git a/.github/workflows/cuda.yml b/.github/workflows/cuda.yml new file mode 100644 index 0000000..a7037a4 --- /dev/null +++ b/.github/workflows/cuda.yml @@ -0,0 +1,40 @@ +name: CUDA CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + cuda-build-and-test: + runs-on: ubuntu-latest + container: + image: nvidia/cuda:11.4.2-devel-ubuntu20.04 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + apt-get update && apt-get install -y cmake build-essential libboost-all-dev libhdf5-dev libgmp-dev libtbb-dev + # Add additional dependencies as needed + + - name: Configure CMake + run: | + mkdir -p build + cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DGPU_CUDA_ON=ON + + - name: Build + run: | + cd build + make -j$(nproc) + + - name: Run Tests + run: | + cd build + ctest --output-on-failure diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml new file mode 100644 index 0000000..b350705 --- /dev/null +++ b/.github/workflows/fedora.yml @@ -0,0 +1,35 @@ +name: Fedora CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: fedora-latest + + strategy: + matrix: + compiler: [gcc-11, gcc-12, gcc-13, gcc-14, clang-8, clang-9] + build_type: [Release, Debug] + technology: [OpenMP, MPI, HDF5] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo dnf install -y cmake boost-devel hdf5-devel gmp-devel tbb-devel + if [[ "${{ matrix.compiler }}" == gcc* ]]; then + sudo dnf install -y ${{ matrix.compiler }} ${{ matrix.compiler }}-base; + elif [[ "${{ matrix.compiler }}" == clang* ]]; then + sudo dnf install -y ${{ matrix.compiler }}; + fi + if [[ "${{ matrix.technology }}" == "MPI" ]]; then + sudo dnf install -y openmpi-devel; + fi diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml new file mode 100644 index 0000000..f600d48 --- /dev/null +++ b/.github/workflows/ubuntu.yml @@ -0,0 +1,56 @@ +name: Ubuntu CI + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + strategy: + matrix: + compiler: [gcc-11, gcc-12, gcc-13, gcc-14, clang-8, clang-9] + build_type: [Release, Debug] + technology: [OpenMP, MPI, HDF5] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake build-essential libboost-all-dev libhdf5-dev libgmp-dev libtbb-dev + if [[ "${{ matrix.compiler }}" == gcc* ]]; then + sudo apt-get install -y ${{ matrix.compiler }} ${{ matrix.compiler }}-base; + elif [[ "${{ matrix.compiler }}" == clang* ]]; then + sudo apt-get install -y ${{ matrix.compiler }}; + fi + if [[ "${{ matrix.technology }}" == "MPI" ]]; then + sudo apt-get install -y libopenmpi-dev openmpi-bin; + fi + + - name: Configure CMake + run: | + mkdir -p build + cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ + -DSTART_OPENMP_ON=${{ matrix.technology == 'OpenMP' }} \ + -DSTART_MPI_ON=${{ matrix.technology == 'MPI' }} \ + -DHDF5_FOUND=${{ matrix.technology == 'HDF5' }} + + - name: Build + run: | + cd build + make -j$(nproc) + + - name: Run Tests + run: | + cd build + ctest --output-on-failure