Skip to content

Commit 6c9eff1

Browse files
committed
Switch to Github Actions on ocl-open-90
Signed-off-by: haonanya <[email protected]>
1 parent bf22153 commit 6c9eff1

File tree

3 files changed

+82
-61
lines changed

3 files changed

+82
-61
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: In-tree build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- ocl-open-90
8+
paths-ignore: # no need to check build for:
9+
- 'docs/**' # documentation
10+
- '**.md' # README
11+
pull_request:
12+
branches:
13+
- master
14+
- ocl-open-90
15+
paths-ignore: # no need to check build for:
16+
- 'docs/**' # documentation
17+
- '**.md' # README
18+
schedule:
19+
# Weekly build on Mondays
20+
# Ideally, we might want to simplify our regular nightly build as we
21+
# probably don't need every configuration to be built every day: most of
22+
# them are only necessary in pre-commits to avoid breakages
23+
- cron: 0 0 * * 0
24+
25+
env:
26+
LLVM_VERSION: 9
27+
28+
jobs:
29+
build_and_test_linux:
30+
name: Linux
31+
strategy:
32+
matrix:
33+
build_type: [Release, Debug]
34+
include:
35+
- build_type: Release
36+
fail-fast: false
37+
runs-on: ubuntu-18.04
38+
steps:
39+
- name: Install dependencies
40+
run: |
41+
curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
42+
curl -L "https://packages.lunarg.com/lunarg-signing-key-pub.asc" | sudo apt-key add -
43+
echo "deb https://apt.llvm.org/bionic/ llvm-toolchain-bionic-${{ env.LLVM_VERSION }} main" | sudo tee -a /etc/apt/sources.list
44+
echo "deb https://packages.lunarg.com/vulkan bionic main" | sudo tee -a /etc/apt/sources.list
45+
sudo apt-get update
46+
- name: Checkout LLVM sources
47+
uses: actions/checkout@v2
48+
with:
49+
repository: llvm/llvm-project
50+
ref: release/9.x
51+
path: llvm-project
52+
- name: Checkout the translator sources
53+
uses: actions/checkout@v2
54+
with:
55+
repository: KhronosGroup/SPIRV-LLVM-Translator
56+
ref: llvm_release_90
57+
path: llvm-project/SPIRV-LLVM-Translator
58+
- name: Checkout opencl-clang sources
59+
uses: actions/checkout@v2
60+
with:
61+
path: llvm-project/opencl-clang
62+
- name: Configure
63+
run: |
64+
mkdir build && cd build
65+
cmake ${{ github.workspace }}/llvm-project/llvm \
66+
-DLLVM_ENABLE_PROJECTS="clang" \
67+
-DLLVM_EXTERNAL_PROJECTS="llvm-spirv;opencl-clang" \
68+
-DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=${{ github.workspace }}/llvm-project/SPIRV-LLVM-Translator \
69+
-DLLVM_EXTERNAL_OPENCL_CLANG_SOURCE_DIR=${{ github.workspace }}/llvm-project/opencl-clang \
70+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
71+
-DLLVM_TARGETS_TO_BUILD="X86" \
72+
-G "Unix Makefiles"
73+
- name: Build
74+
run: |
75+
cd build
76+
77+
make opencl-clang -j2

.travis.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

cmake/modules/CMakeFunctions.cmake

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,26 +145,24 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
145145
COMMAND ${GIT_EXECUTABLE} am --3way --ignore-whitespace ${patch}
146146
WORKING_DIRECTORY ${repo_dir}
147147
OUTPUT_VARIABLE patching_log
148-
ERROR_QUIET
149148
RESULT_VARIABLE ret_apply_patch
150149
)
151150
message(STATUS "[OPENCL-CLANG] Not present - ${patching_log}")
151+
if (NOT (ret_not_git_repo OR ret_check_out OR ret_apply_patch))
152+
set(${ret} True PARENT_SCOPE)
153+
else()
154+
message(FATAL_ERROR "[OPENCL-CLANG] Failed to apply patch!")
155+
endif()
152156
endif()
153157
endforeach(patch)
154158
else() # The target branch already exists
155159
execute_process( # Check it out
156160
COMMAND ${GIT_EXECUTABLE} checkout ${target_branch}
157161
WORKING_DIRECTORY ${repo_dir}
158162
RESULT_VARIABLE ret_check_out
159-
ERROR_QUIET
160163
OUTPUT_QUIET
161164
)
162165
endif()
163-
if (NOT (ret_not_git_repo OR ret_check_out OR ret_apply_patch))
164-
set(${ret} True PARENT_SCOPE)
165-
else()
166-
message(FATAL_ERROR "[OPENCL-CLANG] Failed to apply patch!")
167-
endif()
168166
endfunction()
169167

170168
# Usage

0 commit comments

Comments
 (0)