forked from intel/opencl-clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathon-push-verification-out-of-tree.yml
More file actions
87 lines (76 loc) · 2.96 KB
/
on-push-verification-out-of-tree.yml
File metadata and controls
87 lines (76 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# ===---
# Running on push & pull_request.
# ===---
name: Out-of-tree build
run-name: '${{ github.event_name }}: ${{ github.base_ref }} ${{ github.ref_name }}' # github.base_ref null for 'on: push'
permissions:
contents: read
env:
LLVM_VERSION: 21
LLVM_VERSION_MINOR: 1
on:
push:
branches:
- ocl-open-210
pull_request:
branches:
- ocl-open-210
types:
- opened
- reopened
- synchronize # commit pushed to the PR
- ready_for_review # moved from draft state
jobs:
verify_default_branch:
name: linux
# ref_name for 'on: push'
# base_ref for 'on: pull_request'
runs-on: ubuntu-24.04
steps:
- name: Install llvm and its dependencies
run: |
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/llvm.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm.list
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install \
clang-${{ env.LLVM_VERSION }} \
clang-tools-${{ env.LLVM_VERSION }} \
llvm-${{ env.LLVM_VERSION }}-dev \
libllvmlibc-${{ env.LLVM_VERSION }}-dev \
libclang-${{ env.LLVM_VERSION }}-dev \
libclang-cpp${{ env.LLVM_VERSION }}-dev \
libpolly-${{ env.LLVM_VERSION }}-dev \
libzstd-dev \
libedit-dev \
mlir-${{ env.LLVM_VERSION }}-tools
- name: Checkout SPIRV-LLVM-Translator sources
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
repository: KhronosGroup/SPIRV-LLVM-Translator
path: SPIRV-LLVM-Translator
ref: llvm_release_210
- name: Build SPIRV-LLVM-Translator
run: |
builddir=${{ github.workspace }}/SPIRV-LLVM-Translator/build
cmake -B "$builddir" \
${{ github.workspace }}/SPIRV-LLVM-Translator \
-DLLVM_INCLUDE_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="$builddir"/install \
-DCMAKE_BUILD_TYPE=Release
cmake --build "$builddir" -j $(nproc)
cmake --install "$builddir"
echo "spirv_translator_install_dir=${builddir}/install" >> $GITHUB_ENV
- name: Checkout opencl-clang sources
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
path: opencl-clang
ref: ${{ github.ref }}
- name: Build opencl-clang
run: |
mkdir build && cd build
cmake ${{ github.workspace }}/opencl-clang \
-DPREFERRED_LLVM_VERSION="${{ env.LLVM_VERSION }}.${{ env.LLVM_VERSION_MINOR }}" \
-DLLVMSPIRV_INCLUDED_IN_LLVM=OFF \
-DSPIRV_TRANSLATOR_DIR=${{ env.spirv_translator_install_dir }} \
-DCMAKE_BUILD_TYPE=Release
cmake --build . -j $(nproc)