Skip to content

Commit 1f3bd3d

Browse files
author
Alexander Batashev
authored
[CI] Add post-commit checks for Linux (#1313)
Signed-off-by: Alexander Batashev <alexander.batashev@intel.com>
1 parent f7cf289 commit 1f3bd3d

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Linux Post Commit Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- sycl
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
config: ["Default", "SharedLibs", "Assertions"]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
path: src
19+
- name: Install Ubuntu deps
20+
run: sudo apt install -y ninja-build
21+
- name: Configure
22+
run: |
23+
CONFIG=${{ matrix.config }}
24+
case $CONFIG in
25+
Default)
26+
export ARGS=""
27+
;;
28+
SharedLibs)
29+
export ARGS="--shared-libs"
30+
;;
31+
Assertiosn)
32+
export ARGS="--assertions"
33+
;;
34+
esac
35+
mkdir -p $GITHUB_WORKSPACE/build
36+
cd $GITHUB_WORKSPACE/build
37+
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
38+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --no-ocl $ARGS
39+
- name: Compile
40+
run: |
41+
python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \
42+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build
43+
- name: check-llvm
44+
if: always()
45+
run: |
46+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
47+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm
48+
- name: check-clang
49+
if: always()
50+
run: |
51+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
52+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-clang
53+
- name: check-sycl
54+
if: always()
55+
run: |
56+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
57+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-sycl
58+
- name: check-llvm-spirv
59+
if: always()
60+
run: |
61+
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
62+
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm-spirv
63+
- name: Pack
64+
run: tar -czvf llvm_sycl.tar.gz -C $GITHUB_WORKSPACE/build/install .
65+
- name: Upload artifacts
66+
uses: actions/upload-artifact@v1
67+
with:
68+
name: sycl_linux_${{ matrix.config }}
69+
path: llvm_sycl.tar.gz
70+

buildbot/configure.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ def do_configure(args):
1919
sycl_build_pi_cuda = 'OFF'
2020
llvm_enable_assertions = 'ON'
2121
llvm_enable_doxygen = 'OFF'
22+
llvm_build_shared_libs = 'OFF'
2223

2324
if platform.system() == 'Linux':
2425
icd_loader_lib = os.path.join(icd_loader_lib, "libOpenCL.so")
@@ -37,6 +38,9 @@ def do_configure(args):
3738
if args.docs:
3839
llvm_enable_doxygen = 'ON'
3940

41+
if args.shared_libs:
42+
llvm_build_shared_libs = 'ON'
43+
4044
install_dir = os.path.join(args.obj_dir, "install")
4145

4246
cmake_cmd = [
@@ -59,10 +63,16 @@ def do_configure(args):
5963
"-DCMAKE_INSTALL_PREFIX={}".format(install_dir),
6064
"-DSYCL_INCLUDE_TESTS=ON", # Explicitly include all kinds of SYCL tests.
6165
"-DLLVM_ENABLE_DOXYGEN={}".format(llvm_enable_doxygen),
66+
"-DBUILD_SHARED_LIBS={}".format(llvm_build_shared_libs),
6267
"-DSYCL_ENABLE_XPTI_TRACING=ON", # Explicitly turn on XPTI tracing
6368
llvm_dir
6469
]
6570

71+
if not args.no_ocl:
72+
cmake_cmd.extend([
73+
"-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir),
74+
"-DOpenCL_LIBRARY={}".format(icd_loader_lib)])
75+
6676
print(cmake_cmd)
6777

6878
try:
@@ -93,6 +103,8 @@ def main():
93103
parser.add_argument("--cuda", action='store_true', help="switch from OpenCL to CUDA")
94104
parser.add_argument("--assertions", action='store_true', help="build with assertions")
95105
parser.add_argument("--docs", action='store_true', help="build Doxygen documentation")
106+
parser.add_argument("--no-ocl", action='store_true', help="download OpenCL deps via CMake")
107+
parser.add_argument("--shared-libs", action='store_true', help="Build shared libraries")
96108

97109
args = parser.parse_args()
98110

0 commit comments

Comments
 (0)