-
Notifications
You must be signed in to change notification settings - Fork 220
94 lines (91 loc) · 3.71 KB
/
check-out-of-tree-build.yml
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
88
89
90
91
92
93
94
# This workflow is intended to check that out-of-tree build of the translator is
# healthy and all tests pass. It is used in pre-commits and nightly builds.
#
# Documentation for GitHub Actions:
# [workflow-syntax]: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
# [context-and-expression-syntax]: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions
name: Out-of-tree build & tests
on:
push:
branches:
- main
- llvm_release_*
paths-ignore: # no need to check build for:
- 'docs/**' # documentation
- '**.md' # README
- '**/check-code-style.yml' # check-code-style workflow
- '**/check-in-tree-build.yml' # check-in-tree-build workflow
pull_request:
branches:
- main
- llvm_release_*
paths-ignore: # no need to check build for:
- 'docs/**' # documentation
- '**.md' # README
- '**/check-code-style.yml' # check-code-style workflow
- '**/check-in-tree-build.yml' # check-in-tree-build workflow
schedule:
- cron: 0 0 * * *
env:
LLVM_VERSION: 20
jobs:
build_and_test:
name: Linux
strategy:
matrix:
build_type: [Release, Debug]
fail-fast: false
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
curl -L "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add -
curl -L "https://packages.lunarg.com/lunarg-signing-key-pub.asc" | sudo apt-key add -
echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy main" | sudo tee -a /etc/apt/sources.list
echo "deb https://packages.lunarg.com/vulkan jammy main" | sudo tee -a /etc/apt/sources.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 \
libomp-${{ env.LLVM_VERSION }}-dev \
llvm-${{ env.LLVM_VERSION }}-tools \
mlir-${{ env.LLVM_VERSION }}-tools \
libpolly-${{ env.LLVM_VERSION }}-dev \
spirv-tools
# Linux systems in GitHub Actions already have older versions of clang
# pre-installed. Make sure to override these with the relevant version.
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{ env.LLVM_VERSION }} 1000
- name: Checkout the translator sources
uses: actions/checkout@v4
with:
path: SPIRV-LLVM-Translator
- name: Get tag for SPIR-V Headers
id: spirv-headers-tag
run: |
echo "spirv_headers_tag=$(cat SPIRV-LLVM-Translator/spirv-headers-tag.conf)" >> $GITHUB_ENV
- name: Checkout SPIR-V Headers
uses: actions/checkout@v4
with:
repository: KhronosGroup/SPIRV-Headers
ref: ${{ env.spirv_headers_tag }}
path: SPIRV-Headers
- name: Configure
run: |
mkdir build && cd build
cmake ${{ github.workspace }}/SPIRV-LLVM-Translator \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_FLAGS="-Werror" \
-DLLVM_INCLUDE_TESTS=ON \
-DLLVM_EXTERNAL_LIT="/usr/lib/llvm-${{ env.LLVM_VERSION }}/build/utils/lit/lit.py" \
-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${{ github.workspace }}/SPIRV-Headers \
-G "Unix Makefiles"
- name: Build
run: |
cd build
make llvm-spirv -j2
- name: Build tests & test
run: |
cd build
make check-llvm-spirv -j2