Skip to content

Commit b81d1e2

Browse files
sevenbunuvkutuev
andauthored
ci: Configure CI on self-hosted runner (#236)
* ci: add ci for self hosted runner * style: changes accoeding to clang formatter * test: add intel gpu * gh-235: add pocl cpu support * fix: change vendor id for pocl * ref: changes in env variable name * style: changes according to clang formatter * test: run in debug mode * ci: run all in debug mode * ci: delete trigger branch * ref: change name of job in ubuntu * fix: add correct job name * ci: run github hosted runners in release mode * style: add newlines in the end of files * fix: change type to cpu * fix: change number * ci: add check for failed in all cases * Revert "gh-235: add pocl cpu support" This reverts commit 18fe4fb. * fix: full remove pocl support * style: add newlines in the end of files * style: add newline in opencl merge * fix: change platforms to devices --------- Co-authored-by: Vladimir Kutuev <vladimir.kutuev@gmail.com>
1 parent 46b8a01 commit b81d1e2

24 files changed

+410
-92
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@ on:
2121
branches: [ main ]
2222

2323
env:
24-
build_dir: "build"
24+
build-dir: "build"
2525
config: "Release"
2626
artifact: "native"
2727
nt: "4"
2828

2929
jobs:
30-
3130
windows:
32-
runs-on: windows-2019
31+
runs-on: windows-2022
3332
steps:
34-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
3534
with:
3635
submodules: true
3736
fetch-depth: 0
@@ -43,68 +42,51 @@ jobs:
4342
arch: amd64
4443

4544
- name: Configure CMake
46-
run: cmake . -G Ninja -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }}
45+
run: |
46+
cmake . -G Ninja -B ${{ env.build-dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DSPLA_BUILD_OPENCL=OFF
4747
4848
- name: Build library sources
49-
run: cmake --build ${{ env.build_dir }}
49+
run: cmake --build ${{ env.build-dir }} --verbose -j ${{ env.nt }}
5050

5151
- name: Upload binary
5252
uses: actions/upload-artifact@v4
5353
with:
5454
name: windows-${{env.artifact}}
55-
path: ${{env.build_dir}}/spla_x64.dll
56-
57-
58-
ubuntu:
59-
runs-on: ubuntu-24.04
60-
steps:
61-
- uses: actions/checkout@v4
62-
with:
63-
submodules: true
64-
fetch-depth: 0
65-
66-
- uses: seanmiddleditch/gha-setup-ninja@master
67-
68-
- name: Configure CMake
69-
run: cmake . -G Ninja -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }}
70-
71-
- name: Build library sources
72-
run: cmake --build ${{ env.build_dir }}
73-
74-
- name: Upload binary
75-
uses: actions/upload-artifact@v4
76-
with:
77-
name: linux-${{env.artifact}}
78-
path: ${{env.build_dir}}/libspla_x64.so
55+
path: ${{env.build-dir}}/spla_x64.dll
7956

8057
macos:
8158
runs-on: macos-14
8259
steps:
83-
- uses: actions/checkout@v4
60+
- uses: actions/checkout@v5
8461
with:
8562
submodules: true
8663
fetch-depth: 0
8764

8865
- uses: seanmiddleditch/gha-setup-ninja@master
8966

9067
- name: Configure CMake x64
91-
run: cmake . -G Ninja -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCMAKE_OSX_ARCHITECTURES=x86_64
68+
run: cmake . -G Ninja -B ${{ env.build-dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCMAKE_OSX_ARCHITECTURES=x86_64
9269

9370
- name: Build library sources x64
94-
run: cmake --build ${{ env.build_dir }}
71+
run: cmake --build ${{ env.build-dir }}
9572

9673
- name: Configure CMake arm64
97-
run: cmake . -G Ninja -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DCMAKE_OSX_ARCHITECTURES=arm64
74+
run: |
75+
cmake . -G Ninja \
76+
-B ${{ env.build-dir }} \
77+
-DCMAKE_BUILD_TYPE=${{ env.config }} \
78+
-DCMAKE_OSX_ARCHITECTURES=arm64 \
79+
-DSPLA_BUILD_OPENCL=OFF
9880
env:
9981
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
10082

10183
- name: Build library sources arm64
102-
run: cmake --build ${{ env.build_dir }}
84+
run: cmake --build ${{ env.build-dir }} --verbose -j ${{ env.nt }}
10385

10486
- name: Upload binary
10587
uses: actions/upload-artifact@v4
10688
with:
10789
name: macos-${{env.artifact}}
10890
path: |
109-
${{env.build_dir}}/libspla_x64.dylib
110-
${{env.build_dir}}/libspla_arm64.dylib
91+
${{env.build-dir}}/libspla_x64.dylib
92+
${{env.build-dir}}/libspla_arm64.dylib

.github/workflows/clang-format.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ jobs:
2626
- 'tests'
2727
- 'examples'
2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v5
30+
3031
- name: Run clang-format style check
31-
uses: jidicula/clang-format-action@v4.10.1
32+
uses: jidicula/clang-format-action@v4.15.0
3233
with:
33-
clang-format-version: '15'
34+
clang-format-version: '20'
3435
check-path: ${{ matrix.path }}

.github/workflows/deploy-test.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Python Package (Test)
22

33
on:
44
workflow_run:
5-
workflows: [ "Build" ]
5+
workflows: [ Build ]
66
branches: [ "pre-release" ]
77
types:
88
- completed
@@ -14,10 +14,8 @@ jobs:
1414
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1515

1616
steps:
17-
- uses: actions/checkout@v2
18-
1917
- name: Set up Python
20-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v6
2119
with:
2220
python-version: '3.8'
2321

@@ -27,7 +25,7 @@ jobs:
2725
pip install setuptools wheel twine
2826
2927
- name: Download artifact
30-
uses: dawidd6/action-download-artifact@v2
28+
uses: dawidd6/action-download-artifact@v5
3129
with:
3230
workflow: build.yml
3331
workflow_conclusion: success

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ jobs:
1414
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1515

1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v5
1818

1919
- name: Set up Python
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v6
2121
with:
22-
python-version: '3.8'
22+
python-version: '3.12.5'
2323

2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
2727
pip install setuptools wheel twine
2828
2929
- name: Download artifact
30-
uses: dawidd6/action-download-artifact@v2
30+
uses: dawidd6/action-download-artifact@v5
3131
with:
3232
workflow: build.yml
3333
workflow_conclusion: success

.github/workflows/docs-cpp.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v5
2121

2222
- name: Generate documentation
23-
uses: mattnotmitt/doxygen-action@v1.3.1
23+
uses: mattnotmitt/doxygen-action@v1.12.0
2424

2525
- name: Publish to Github Pages
26-
uses: peaceiris/actions-gh-pages@v3
26+
uses: peaceiris/actions-gh-pages@v4
2727
with:
2828
github_token: ${{ secrets.GITHUB_TOKEN }}
2929
publish_dir: ./html/

.github/workflows/docs-python.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: [ 3.8 ]
17+
python-version: [ 3.12.5 ]
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v5
2020

2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v6
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

@@ -32,8 +32,8 @@ jobs:
3232
SPLA_DOCS: true
3333

3434
- name: Publish to Github Pages
35-
uses: peaceiris/actions-gh-pages@v3
35+
uses: peaceiris/actions-gh-pages@v4
3636
with:
3737
github_token: ${{ secrets.GITHUB_TOKEN }}
3838
publish_dir: ./pydocs/
39-
destination_dir: docs-python
39+
destination_dir: docs-python

.github/workflows/self-hosted.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Self-Hosted
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release
8+
- pre-release
9+
paths:
10+
- '.github/**'
11+
- 'deps/**'
12+
- 'include/**'
13+
- 'src/**'
14+
- 'tests/**'
15+
- 'examples/**'
16+
- 'python/**'
17+
- '.gitignore'
18+
- '.gitmodules'
19+
- 'CMakeLists.txt'
20+
pull_request:
21+
branches: [ main ]
22+
23+
env:
24+
build-dir: "build"
25+
26+
jobs:
27+
build:
28+
name: Build ${{ matrix.os }}
29+
runs-on: self-hosted
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
include:
34+
- os: ubuntu-24.04
35+
env:
36+
config: "Release"
37+
nt: "4"
38+
39+
steps:
40+
- uses: actions/checkout@v5
41+
with:
42+
submodules: true
43+
fetch-depth: 0
44+
45+
- name: Configure CMake
46+
run: |
47+
cmake . -G Ninja \
48+
-B ${{ env.build-dir }} \
49+
-DCMAKE_BUILD_TYPE=${{ env.config }} \
50+
-DSPLA_BUILD_TESTS=ON
51+
52+
- name: Build library sources
53+
run: |
54+
cmake --build ${{ env.build-dir }} \
55+
--target all \
56+
--verbose \
57+
-j ${{ env.nt }}
58+
59+
test:
60+
name: Test GPU ${{ matrix.gpu }}
61+
needs: build
62+
runs-on: self-hosted
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
include:
67+
- gpu: NVIDIA-GeForce-GT-1030
68+
platform: 2
69+
device: 0
70+
- gpu: AMD-Radeon-RX-6750-XT
71+
platform: 1
72+
device: 0
73+
74+
env:
75+
test-file: ${{ matrix.gpu }}_tests.log
76+
77+
steps:
78+
- name: Run tests
79+
run: |
80+
python3 ./run_tests.py --build-dir=${{ env.build-dir }} \
81+
--platform=${{ matrix.platform }} \
82+
--device=${{ matrix.device }} \
83+
| tee ${{ env.test-file }}
84+
85+
- name: Upload tests resutls
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: ${{ env.test-file }}
89+
path: ${{ env.test-file }}
90+
91+
- name: Check for tests results
92+
run: |
93+
! grep -qi "FAILED" ${{ env.test-file }}
94+
95+
clean:
96+
name: Cleanup workspace
97+
needs: test
98+
if: always()
99+
runs-on: self-hosted
100+
101+
steps:
102+
- name: Cleanup workspace
103+
run: |
104+
rm -rf ${{ github.workspace }}/*
105+
rm -rf ${{ github.workspace }}/.*

0 commit comments

Comments
 (0)