Skip to content

Commit a397c06

Browse files
authored
Switch to Github Actions on ocl-open-90 (#318)
Signed-off-by: haonanya <[email protected]>
1 parent bf22153 commit a397c06

File tree

2 files changed

+82
-0
lines changed

2 files changed

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

cmake/modules/CMakeFunctions.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ function(apply_patches repo_dir patches_dirs base_revision target_branch ret)
149149
RESULT_VARIABLE ret_apply_patch
150150
)
151151
message(STATUS "[OPENCL-CLANG] Not present - ${patching_log}")
152+
if (ret_apply_patch)
153+
break()
154+
endif()
152155
endif()
153156
endforeach(patch)
154157
else() # The target branch already exists

0 commit comments

Comments
 (0)