Skip to content

Commit aa64a88

Browse files
committed
ci: add separate pipeline for self-hosted
1 parent d7c0088 commit aa64a88

File tree

2 files changed

+97
-47
lines changed

2 files changed

+97
-47
lines changed

.github/workflows/self-hosted.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Original script from https://github.com/ptheywood/cuda-cmake-github-actions
2+
3+
name: Ubuntu
4+
5+
on:
6+
push:
7+
branches: [ master, self-hosted-runner ]
8+
pull_request:
9+
branches: [ master ]
10+
workflow_dispatch:
11+
12+
env:
13+
build_dir: "build"
14+
config: "Release"
15+
16+
jobs:
17+
build:
18+
name: Build ${{ matrix.self-hosted }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
19+
runs-on: ${{ matrix.self-hosted }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- self-hosted: ubuntu-24.04
25+
cuda: "12.8"
26+
gcc: 13
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
with:
31+
submodules: recursive
32+
33+
- uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.12'
36+
37+
- name: Install CUDA
38+
env:
39+
cuda: ${{ matrix.cuda }}
40+
run: source ./scripts/install_cuda_ubuntu.sh
41+
shell: bash
42+
43+
- name: Export gcc and g++ variables
44+
run: |
45+
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
46+
echo "СС=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
47+
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
48+
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
49+
echo "CUDACXX=/usr/local/cuda-${{ matrix.cuda }}/bin/nvcc" >> $GITHUB_ENV
50+
51+
- name: Configure CMake build
52+
run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON
53+
54+
- name: Build library sources
55+
working-directory: ${{ env.build_dir }}
56+
run: cmake --build . --target all --verbose -j `nproc`
57+
58+
test:
59+
name: Test ${{ matrix.self-hosted }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
60+
needs: build
61+
runs-on: ${{ matrix.self-hosted }}
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
include:
66+
- self-hosted: ubuntu-24.04
67+
cuda: "12.8"
68+
gcc: 13
69+
70+
steps:
71+
- name: Run unit-tests
72+
working-directory: ${{ env.build_dir }}
73+
run: bash scripts/run_tests_fallback.sh
74+
shell: bash
75+
76+
- name: Run regression-tests
77+
working-directory: ${{ env.build_dir }}/python
78+
run: bash run_tests.sh
79+
shell: bash

.github/workflows/ubuntu.yml

Lines changed: 18 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ on:
99
branches: [ master ]
1010
workflow_dispatch:
1111

12-
env:
13-
build_dir: "build"
14-
config: "Release"
15-
artifact: "cubool-ubuntu-build.tar.xz"
16-
1712
jobs:
1813
build:
1914
name: Build ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
@@ -22,9 +17,13 @@ jobs:
2217
fail-fast: false
2318
matrix:
2419
include:
25-
- os: ubuntu-24.04
26-
cuda: "12.8"
27-
gcc: 13
20+
- os: [ubuntu-18.04, ubuntu-24.04]
21+
cuda: ["10.1", "12.8"]
22+
gcc: [8, 13]
23+
env:
24+
build_dir: "build"
25+
config: "Release"
26+
artifact: "cubool-${{ matrix.os }}-build.tar.xz"
2827

2928
steps:
3029
- uses: actions/checkout@v4
@@ -36,12 +35,18 @@ jobs:
3635
python-version: '3.12'
3736

3837
- name: Install CUDA
39-
env:
40-
cuda: ${{ matrix.cuda }}
41-
run: source ./scripts/install_cuda_ubuntu.sh
38+
run: |
39+
source ./scripts/install_cuda_ubuntu.sh
40+
if [[ $? -eq 0 ]]; then
41+
# Set paths for subsequent steps, using ${CUDA_PATH}
42+
echo "Adding CUDA to CUDA_PATH, PATH and LD_LIBRARY_PATH"
43+
echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV
44+
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
45+
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
46+
fi
4247
shell: bash
4348

44-
- name: Export gcc and g++ variables
49+
- name: Install and configure GCC and GXX
4550
run: |
4651
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
4752
echo "СС=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
@@ -52,7 +57,7 @@ jobs:
5257
- name: Configure CMake build
5358
run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON
5459

55-
- name: Build librarnamey sources
60+
- name: Build library sources
5661
working-directory: ${{ env.build_dir }}
5762
run: cmake --build . --target all --verbose -j `nproc`
5863

@@ -65,37 +70,3 @@ jobs:
6570
with:
6671
name: ${{ env.artifact }}
6772
path: ${{ env.artifact }}
68-
69-
70-
test:
71-
name: Test ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
72-
needs: build
73-
runs-on: self-hosted
74-
strategy:
75-
fail-fast: false
76-
matrix:
77-
include:
78-
- os: ubuntu-24.04
79-
cuda: "12.8"
80-
gcc: 13
81-
82-
steps:
83-
- name: Download binary artifact
84-
uses: actions/download-artifact@v4
85-
with:
86-
name: ${{ env.artifact }}
87-
88-
- name: Unarchive artifact
89-
run: |
90-
tar xzf ${{ env.artifact }}
91-
rm ${{ env.artifact }}
92-
93-
- name: Run unit-tests
94-
working-directory: ${{ env.build_dir }}
95-
run: bash scripts/run_tests_fallback.sh
96-
shell: bash
97-
98-
- name: Run regression-tests
99-
working-directory: ${{ env.build_dir }}/python
100-
run: bash run_tests.sh
101-
shell: bash

0 commit comments

Comments
 (0)