From 0c4e38b0027a321535209d4671371657e53548fc Mon Sep 17 00:00:00 2001 From: Kostya Oreshin Date: Mon, 22 Sep 2025 23:42:12 +0300 Subject: [PATCH 01/15] ci: add build + test on ubuntu and self-hosted --- .github/workflows/self-hosted.yml | 97 +++++++++++++++++++++++ .github/workflows/ubuntu.yml | 123 ++++++++++++++++++++---------- 2 files changed, 180 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/self-hosted.yml diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml new file mode 100644 index 0000000..8ef2a3f --- /dev/null +++ b/.github/workflows/self-hosted.yml @@ -0,0 +1,97 @@ +name: Self-Hosted + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +env: + build_dir: "build" + +jobs: + build: + name: Build ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }} + runs-on: self-hosted + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04 + cuda: "12.8" + gcc: 14 + env: + config: "Release" + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set environment variables + run: | + echo "CUDA_PATH=/usr/local/cuda-12.8" >> $GITHUB_ENV + echo "${CUDA_PATH}/bin" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV + echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV + echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV + echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV + echo "CUDACXX=/usr/local/cuda-${{ matrix.cuda }}/bin/nvcc" >> $GITHUB_ENV + + - name: Configure CMake build + run: | + cmake -B ${{ env.build_dir }} -S . \ + -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc }} \ + -DCMAKE_C_COMPILER=gcc-${{ matrix.gcc }} \ + -DCMAKE_BUILD_TYPE=${{ env.config }} \ + -DCUBOOL_BUILD_TESTS=ON \ + -DCUBOOL_GRAPH_ENABLE_TESTING=ON + + - name: Build library sources + run: | + cmake --build ${{ env.build_dir }} \ + --verbose \ + -j10 + + test: + name: Test GPU ${{ matrix.gpu }} CUDA ${{ matrix.cuda }} + needs: build + runs-on: self-hosted + strategy: + fail-fast: false + matrix: + include: + - gpu: NVIDIA-GeForce-GT-1030 + cuda: "12.9" + env: + test-file: gpu_test.log + + steps: + - name: Run tests + working-directory: ${{ env.build_dir }}/tests + run: | + bash cuboolgraph_tests | tee ${{ env.test-file }} + + - name: Upload tests resutls + uses: actions/upload-artifact@v4 + with: + name: ${{ env.test-file }} + path: ${{ env.build_dir }}/tests/${{ env.test-file }} + + - name: Check for unit tests results + working-directory: ${{ env.build_dir }}/tests + run: | + ! grep -q "FAILED" ${{ env.test-file }} + + clean: + name: Cleanup workspace + needs: test + if: always() + runs-on: self-hosted + + steps: + - name: Cleanup workspace + run: | + rm -rf ${{ github.workspace }}/* + rm -rf ${{ github.workspace }}/.* diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 0da2f3b..7386cb8 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,54 +1,97 @@ -name: Compile, run tests and check code style +name: Ubuntu on: push: - branches: - - '**' + branches: [ main ] pull_request: - branches: - - '**' + branches: [ main ] + workflow_dispatch: + +env: + build_dir: "build" + artifact: "cubool-ubuntu-build.tar.xz" jobs: build: + name: Build ${{ matrix.os }} runs-on: ${{ matrix.os }} - strategy: fail-fast: false + matrix: + include: + - os: ubuntu-24.04 + gcc: 14 + + env: + config: "Release" + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Configure CMake build + run: | + cmake -B ${{ env.build_dir }} -S . \ + -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc }} \ + -DCMAKE_C_COMPILER=gcc-${{ matrix.gcc }} \ + -DCMAKE_BUILD_TYPE=${{ env.config }} \ + -DCUBOOL_BUILD_TESTS=ON \ + -DCUBOOL_WITH_CUDA=OFF \ + -DCUBOOL_WITH_SEQUENTIAL=ON \ + -DCUBOOL_GRAPH_ENABLE_TESTING=ON + + - name: Build library sources + run: | + cmake --build ${{ env.build_dir }} \ + --verbose \ + -j10 + + - name: Prepare upload binary + run: | + tar cfz ${{ env.artifact }} ${{ env.build_dir }} + - name: Upload binary + uses: actions/upload-artifact@v4 + with: + name: ${{ env.artifact }} + path: ${{ env.artifact }} + + test: + name: Test CPU ${{ matrix.cpu }} + needs: build + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false matrix: - os: [ubuntu-24.04] - c_compiler: [gcc-14] - cpp_compiler: [g++-14] - build_type: [Release, Debug] + include: + - os: ubuntu-22.04 + cpu: AMD-EPYC-7763 + env: + test-file: cpu_test.log steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Setup enviroment - run: | - sudo apt update - sudo apt install gcc-14 - sudo apt install g++-14 - sudo apt install cmake - sudo apt install clang-format - - - name: Configure CMake - run: | - cd ${{ github.workspace }} - cmake -B build -S . \ - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \ - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ - -DCUBOOL_GRAPH_ENABLE_TESTING=ON \ - -DCUBOOL_WITH_CUDA=OFF \ - -DCUBOOL_WITH_SEQUENTIAL=ON - - - name: Build - run: | - cmake --build build -j10 - - - name: Run tests - run: | - ./build/tests/cuboolgraph_tests + - uses: actions/download-artifact@v4 + with: + name: ${{ env.artifact }} + + - name: Unarchive artifact + run: | + tar xzf ${{ env.artifact }} + rm ${{ env.artifact }} + + - name: Run tests + working-directory: ${{ env.build_dir }}/tests + run: | + bash cuboolgraph_tests | tee ${{ env.test-file }} + + - name: Upload tests resutls + uses: actions/upload-artifact@v4 + with: + name: ${{ env.test-file }} + path: ${{ env.build_dir }}/tests/${{ env.test-file }} + + - name: Check for unit tests results + working-directory: ${{ env.build_dir }}/tests + run: | + ! grep -q "FAILED" ${{ env.test-file }} From a85b0a6b43a50b4e17a695013ee027e7d9247607 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin Date: Tue, 23 Sep 2025 00:40:55 +0300 Subject: [PATCH 02/15] test: add runner branch as trigger branch --- .github/workflows/self-hosted.yml | 4 ++-- .github/workflows/ubuntu.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 8ef2a3f..1e01791 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -2,9 +2,9 @@ name: Self-Hosted on: push: - branches: [ master ] + branches: [ master, self-hosted-runner ] pull_request: - branches: [ master ] + branches: [ master, self-hosted-runner ] workflow_dispatch: env: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7386cb8..26a24bf 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -2,9 +2,9 @@ name: Ubuntu on: push: - branches: [ main ] + branches: [ main, self-hosted-runner ] pull_request: - branches: [ main ] + branches: [ main, self-hosted-runner ] workflow_dispatch: env: From 528b096c18e22f4db313587031c1a5f603655e1b Mon Sep 17 00:00:00 2001 From: Kostya Oreshin Date: Tue, 23 Sep 2025 01:02:36 +0300 Subject: [PATCH 03/15] fix: add correct tests start up --- .github/workflows/self-hosted.yml | 4 ++-- .github/workflows/ubuntu.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 1e01791..92ec7c7 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -20,7 +20,7 @@ jobs: include: - os: ubuntu-24.04 cuda: "12.8" - gcc: 14 + gcc: 13 env: config: "Release" @@ -71,7 +71,7 @@ jobs: - name: Run tests working-directory: ${{ env.build_dir }}/tests run: | - bash cuboolgraph_tests | tee ${{ env.test-file }} + ./cuboolgraph_tests | tee ${{ env.test-file }} - name: Upload tests resutls uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 26a24bf..c696c8c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -9,7 +9,7 @@ on: env: build_dir: "build" - artifact: "cubool-ubuntu-build.tar.xz" + artifact: "cuboolgraph-ubuntu-build.tar.xz" jobs: build: @@ -83,7 +83,7 @@ jobs: - name: Run tests working-directory: ${{ env.build_dir }}/tests run: | - bash cuboolgraph_tests | tee ${{ env.test-file }} + ./cuboolgraph_tests | tee ${{ env.test-file }} - name: Upload tests resutls uses: actions/upload-artifact@v4 From dc67a36312a90b299e4b7c40987a1fbc1725e20b Mon Sep 17 00:00:00 2001 From: Kostya Oreshin Date: Tue, 23 Sep 2025 01:30:04 +0300 Subject: [PATCH 04/15] fix: add correct github actions runner --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c696c8c..c164243 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: include: - - os: ubuntu-22.04 + - os: ubuntu-24.04 cpu: AMD-EPYC-7763 env: test-file: cpu_test.log From ea0545de7a6fc16a14db7fd84b98f43036f3f28b Mon Sep 17 00:00:00 2001 From: Kostya Oreshin Date: Tue, 23 Sep 2025 01:49:40 +0300 Subject: [PATCH 05/15] fix: remove extra slash in path --- .github/workflows/self-hosted.yml | 6 +++--- tests/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 92ec7c7..dbd378f 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -2,9 +2,9 @@ name: Self-Hosted on: push: - branches: [ master, self-hosted-runner ] + branches: [ master ] pull_request: - branches: [ master, self-hosted-runner ] + branches: [ master ] workflow_dispatch: env: @@ -20,7 +20,7 @@ jobs: include: - os: ubuntu-24.04 cuda: "12.8" - gcc: 13 + gcc: 14 env: config: "Release" diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9ecd949..a04ce9d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,7 +7,7 @@ target_link_libraries(${TESTS_TARGET} PUBLIC gtest) target_link_libraries(${TESTS_TARGET} PUBLIC fast_matrix_market) target_compile_definitions(${TESTS_TARGET} PUBLIC - TESTS_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/test_data/") + TESTS_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/test_data") # tests files target_sources(${TESTS_TARGET} PUBLIC "rpq_tests.cpp") From 0b0c127f41fcf179cb20643a7515364493260ce7 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin Date: Tue, 23 Sep 2025 03:04:25 +0300 Subject: [PATCH 06/15] ci: try to clone repo and download artifact in separate steps --- .github/workflows/ubuntu.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c164243..4f784a1 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -47,11 +47,11 @@ jobs: --verbose \ -j10 - - name: Prepare upload binary + - name: Prepare upload project run: | - tar cfz ${{ env.artifact }} ${{ env.build_dir }} + tar cfz ${{ env.artifact }} ${{ env.build_dir }} - - name: Upload binary + - name: Upload project uses: actions/upload-artifact@v4 with: name: ${{ env.artifact }} @@ -71,6 +71,10 @@ jobs: test-file: cpu_test.log steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/download-artifact@v4 with: name: ${{ env.artifact }} From 5f9bae339cd1d8e3c0e2fa451f10fa3078e23808 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:28:55 +0300 Subject: [PATCH 07/15] ci: add self hosted branch as trigger --- .github/workflows/self-hosted.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index dbd378f..280b477 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -2,9 +2,9 @@ name: Self-Hosted on: push: - branches: [ master ] + branches: [ master, self-hosted-runner ] pull_request: - branches: [ master ] + branches: [ master, self-hosted-runner ] workflow_dispatch: env: From 685a6172f062fac6ea8e67cd4ea88252ebf3f15b Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:52:33 +0300 Subject: [PATCH 08/15] ci: delete self hosted branch from triggers [skip ci] --- .github/workflows/self-hosted.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 280b477..dbd378f 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -2,9 +2,9 @@ name: Self-Hosted on: push: - branches: [ master, self-hosted-runner ] + branches: [ master ] pull_request: - branches: [ master, self-hosted-runner ] + branches: [ master ] workflow_dispatch: env: From dcf9df2ed8643bccfb7291cf5c4dfc587de42836 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:54:22 +0300 Subject: [PATCH 09/15] ci: delete branch from ubuntu trigger branches [skip ci] --- .github/workflows/ubuntu.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 4f784a1..5df4b62 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -2,9 +2,9 @@ name: Ubuntu on: push: - branches: [ main, self-hosted-runner ] + branches: [ main ] pull_request: - branches: [ main, self-hosted-runner ] + branches: [ main ] workflow_dispatch: env: From 05ebbd30f53dc825caf7e8dc4724cc6022158958 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 16:58:00 +0300 Subject: [PATCH 10/15] chore: return slash to cmake tests --- tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a04ce9d..9ecd949 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,7 +7,7 @@ target_link_libraries(${TESTS_TARGET} PUBLIC gtest) target_link_libraries(${TESTS_TARGET} PUBLIC fast_matrix_market) target_compile_definitions(${TESTS_TARGET} PUBLIC - TESTS_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/test_data") + TESTS_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}/test_data/") # tests files target_sources(${TESTS_TARGET} PUBLIC "rpq_tests.cpp") From 8afe8b2892cc8e94a8e9cc530cf05e00be0a0b53 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:33:02 +0300 Subject: [PATCH 11/15] ci: add correct flags to build --- .github/workflows/self-hosted.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index dbd378f..51f27b8 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -45,7 +45,7 @@ jobs: -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc }} \ -DCMAKE_C_COMPILER=gcc-${{ matrix.gcc }} \ -DCMAKE_BUILD_TYPE=${{ env.config }} \ - -DCUBOOL_BUILD_TESTS=ON \ + -DCUBOOL_WITH_CUDA=ON \ -DCUBOOL_GRAPH_ENABLE_TESTING=ON - name: Build library sources From 29f212d8f643bcb9c86c6bfc2ad5218639cba744 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:34:30 +0300 Subject: [PATCH 12/15] ci: remove incorrect flag from ubuntu job --- .github/workflows/ubuntu.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5df4b62..232d082 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -36,7 +36,6 @@ jobs: -DCMAKE_CXX_COMPILER=g++-${{ matrix.gcc }} \ -DCMAKE_C_COMPILER=gcc-${{ matrix.gcc }} \ -DCMAKE_BUILD_TYPE=${{ env.config }} \ - -DCUBOOL_BUILD_TESTS=ON \ -DCUBOOL_WITH_CUDA=OFF \ -DCUBOOL_WITH_SEQUENTIAL=ON \ -DCUBOOL_GRAPH_ENABLE_TESTING=ON From 1badf9e18e61f1357e2070673d34638e249e9fd4 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:46:41 +0300 Subject: [PATCH 13/15] ci: rename step in stage test self-hosted job --- .github/workflows/self-hosted.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 51f27b8..f744246 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -79,7 +79,7 @@ jobs: name: ${{ env.test-file }} path: ${{ env.build_dir }}/tests/${{ env.test-file }} - - name: Check for unit tests results + - name: Check for tests results working-directory: ${{ env.build_dir }}/tests run: | ! grep -q "FAILED" ${{ env.test-file }} From 80c86a12e03e2a2e211204ce397f13909a8ca6de Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 17:53:48 +0300 Subject: [PATCH 14/15] ci: rename step in stage build in github runner --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 232d082..128c765 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -94,7 +94,7 @@ jobs: name: ${{ env.test-file }} path: ${{ env.build_dir }}/tests/${{ env.test-file }} - - name: Check for unit tests results + - name: Check for tests results working-directory: ${{ env.build_dir }}/tests run: | ! grep -q "FAILED" ${{ env.test-file }} From 26a8af15f205780d8011081614fcc045f4c8bca0 Mon Sep 17 00:00:00 2001 From: Kostya Oreshin <84198636+sevenbunu@users.noreply.github.com> Date: Tue, 23 Sep 2025 18:07:11 +0300 Subject: [PATCH 15/15] fix: add correct trigger branch name --- .github/workflows/self-hosted.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index f744246..e7c1fd1 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -2,9 +2,9 @@ name: Self-Hosted on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] workflow_dispatch: env: