Skip to content

Commit 63e2384

Browse files
committed
ci: add tests on cpu
1 parent 66dead9 commit 63e2384

File tree

3 files changed

+111
-10
lines changed

3 files changed

+111
-10
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Self-Hosted-CPU
2+
3+
on:
4+
push:
5+
branches: [ master, self-hosted-runner ]
6+
pull_request:
7+
branches: [ master ]
8+
workflow_dispatch:
9+
10+
env:
11+
build_dir: "build"
12+
config: "Release"
13+
14+
jobs:
15+
build:
16+
name: Build ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
17+
runs-on: self-hosted
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- os: ubuntu-24.04
23+
cuda: "12.8"
24+
gcc: 13
25+
26+
steps:
27+
- name: Cleanup workspace
28+
run: |
29+
rm -rf ${{ github.workspace }}/*
30+
rm -rf ${{ github.workspace }}/.*
31+
32+
- uses: actions/checkout@v4
33+
with:
34+
submodules: recursive
35+
36+
- name: Set environment variables
37+
run: |
38+
echo "CUDA_PATH=/usr/local/cuda-12.8" >> $GITHUB_ENV
39+
echo "${CUDA_PATH}/bin" >> $GITHUB_PATH
40+
echo "LD_LIBRARY_PATH=${CUDA_PATH}/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
41+
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
42+
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
43+
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
44+
echo "CUDACXX=/usr/local/cuda-${{ matrix.cuda }}/bin/nvcc" >> $GITHUB_ENV
45+
46+
- name: Configure CMake build
47+
run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCUBOOL_BUILD_TESTS=ON -DCUBOOL_WITH_CUDA=OFF
48+
49+
- name: Build library sources
50+
working-directory: ${{ env.build_dir }}
51+
run: cmake --build . --target all --verbose -j `nproc`
52+
53+
test:
54+
name: Test ${{ matrix.cpu }}
55+
needs: build
56+
runs-on: self-hosted
57+
env:
58+
unit-test-file: test_all.txt
59+
regression-test-file: test_regression.txt
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
include:
64+
- cpu: Intel-Core-i7-4790
65+
66+
steps:
67+
- name: Run unit-tests
68+
working-directory: ${{ env.build_dir }}
69+
run: |
70+
chmod +x scripts/run_tests_all.sh
71+
./scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}
72+
73+
- name: Upload unit tests resutls
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: ${{ env.unit-test-file }}
77+
path: ${{ env.build_dir }}/${{ env.unit-test-file }}
78+
79+
- name: Check for unit tests results
80+
working-directory: ${{ env.build_dir }}
81+
run: |
82+
if cat ${{ env.unit-test-file }} | grep -q "FAILED"; then
83+
exit 1
84+
fi
85+
86+
- name: Run regression-tests
87+
working-directory: ${{ env.build_dir }}/python
88+
run: |
89+
chmod +x run_tests.sh
90+
./run_tests.sh | tee ${{ env.regression-test-file }}
91+
92+
- name: Upload regression tests resutls
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: ${{ env.regression-test-file }}
96+
path: ${{ env.build_dir }}/python/${{ env.regression-test-file }}
97+
98+
- name: Check for regression tests results
99+
working-directory: ${{ env.build_dir }}/python
100+
run: |
101+
if cat ${{ env.regression-test-file }} | grep -q "FAILED"; then
102+
exit 1
103+
fi

.github/workflows/self-hosted.yml renamed to .github/workflows/self-hosted-gpu.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Self-Hosted
1+
name: Self-Hosted-GPU
22

33
on:
44
push:
@@ -51,33 +51,31 @@ jobs:
5151
run: cmake --build . --target all --verbose -j `nproc`
5252

5353
test:
54-
name: Test ${{ matrix.os }} GCC ${{ matrix.gcc }} CUDA ${{ matrix.cuda }}
54+
name: Test ${{ matrix.gpu }}
5555
needs: build
5656
runs-on: self-hosted
5757
env:
58-
unit-test-file: test_fallback.txt
58+
unit-test-file: test_all.txt
5959
regression-test-file: test_regression.txt
6060
strategy:
6161
fail-fast: false
6262
matrix:
6363
include:
64-
- os: ubuntu-24.04
65-
cuda: "12.8"
66-
gcc: 13
64+
- gpu: NVIDIA-GeForce-GT-1030
6765

6866
steps:
6967
- name: Run unit-tests
7068
working-directory: ${{ env.build_dir }}
7169
run: |
72-
chmod +x scripts/run_tests_fallback.sh
73-
./scripts/run_tests_fallback.sh | tee ${{ env.unit-test-file }}
70+
chmod +x scripts/run_tests_all.sh
71+
./scripts/run_tests_all.sh | tee ${{ env.unit-test-file }}
7472
7573
- name: Upload unit tests resutls
7674
uses: actions/upload-artifact@v4
7775
with:
7876
name: ${{ env.unit-test-file }}
7977
path: ${{ env.build_dir }}/${{ env.unit-test-file }}
80-
78+
8179
- name: Check for unit tests results
8280
working-directory: ${{ env.build_dir }}
8381
run: |

.github/workflows/ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Install and configure GCC and GXX
5252
run: |
5353
sudo apt-get install -y gcc-${{ matrix.gcc }} g++-${{ matrix.gcc }}
54-
echo "СС=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
54+
echo "CC=/usr/bin/gcc-${{ matrix.gcc }}" >> $GITHUB_ENV
5555
echo "CXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
5656
echo "CUDAHOSTCXX=/usr/bin/g++-${{ matrix.gcc }}" >> $GITHUB_ENV
5757

0 commit comments

Comments
 (0)