Skip to content

[CI] Initial post-commit checks for Linux #1313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/linux_post_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Linux Post Commit Checks

on:
push:
branches:
- sycl
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config: ["Default", "SharedLibs", "Assertions"]

steps:
- uses: actions/checkout@v2
with:
path: src
- name: Install Ubuntu deps
run: sudo apt install -y ninja-build
- name: Configure
run: |
CONFIG=${{ matrix.config }}
case $CONFIG in
Default)
export ARGS=""
;;
SharedLibs)
export ARGS="--shared-libs"
;;
Assertiosn)
export ARGS="--assertions"
;;
esac
mkdir -p $GITHUB_WORKSPACE/build
cd $GITHUB_WORKSPACE/build
python3 $GITHUB_WORKSPACE/src/buildbot/configure.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t Release --no-ocl $ARGS
- name: Compile
run: |
python3 $GITHUB_WORKSPACE/src/buildbot/compile.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build
- name: check-llvm
if: always()
run: |
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm
- name: check-clang
if: always()
run: |
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-clang
- name: check-sycl
if: always()
run: |
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-sycl
- name: check-llvm-spirv
if: always()
run: |
python3 $GITHUB_WORKSPACE/src/buildbot/check.py -w $GITHUB_WORKSPACE \
-s $GITHUB_WORKSPACE/src -o $GITHUB_WORKSPACE/build -t check-llvm-spirv
- name: Pack
run: tar -czvf llvm_sycl.tar.gz -C $GITHUB_WORKSPACE/build/install .
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: sycl_linux_${{ matrix.config }}
path: llvm_sycl.tar.gz

12 changes: 12 additions & 0 deletions buildbot/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def do_configure(args):
sycl_build_pi_cuda = 'OFF'
llvm_enable_assertions = 'ON'
llvm_enable_doxygen = 'OFF'
llvm_build_shared_libs = 'OFF'

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

if args.shared_libs:
llvm_build_shared_libs = 'ON'

install_dir = os.path.join(args.obj_dir, "install")

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

if not args.no_ocl:
cmake_cmd.extend([
"-DOpenCL_INCLUDE_DIR={}".format(ocl_header_dir),
"-DOpenCL_LIBRARY={}".format(icd_loader_lib)])

print(cmake_cmd)

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

args = parser.parse_args()

Expand Down