-
Notifications
You must be signed in to change notification settings - Fork 64
61 lines (59 loc) · 1.91 KB
/
x86-ubuntu-llvm-from-sources.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
name: x86-Ubuntu-llvm-from-sources
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Download Ninja
run: |
git clone https://github.com/ninja-build/ninja.git
pushd ninja
./configure.py --bootstrap
popd
- name: Add Ninja to $PATH
run: |
echo "${GITHUB_WORKSPACE}/ninja" >> $GITHUB_PATH
- name: Clone llvm-project
run: |
git clone --depth 1 --single-branch --branch release/19.x https://github.com/llvm/llvm-project
- name: Make ld.gold the default linker
run: |
# This a quick and easy hack. Not something I would use on my
# production machine.
sudo rm /usr/bin/ld
sudo ln -s /usr/bin/x86_64-linux-gnu-ld.gold /usr/bin/ld
- name: Build LLVM & Clang
run: |
cd llvm-project
git checkout release/19.x
mkdir build && cd build
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="clang" \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
../llvm
ninja
- name: Install lit
run: |
sudo apt-get install python3-setuptools
sudo pip3 install lit
- name: Build HelloWorld
run: |
cd HelloWorld
mkdir build && cd build
# HelloWorld only supports CT_Clang_INSTALL_DIR
cmake -DCT_Clang_INSTALL_DIR="$GITHUB_WORKSPACE/llvm-project/build" ../
make -j2
- name: Build llvm-tutor + run tests
run: |
mkdir build && cd build
# Test with Clang_DIR
cmake -DClang_DIR="$GITHUB_WORKSPACE/llvm-project/build/lib/cmake/clang/" ../
make -j2
lit test/