Skip to content

Commit 5c92252

Browse files
committed
feat: build llvm in docker
1 parent 5e8d664 commit 5c92252

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

.github/workflows/build-llvm.yaml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,51 @@ on:
99
type: string
1010

1111
jobs:
12-
build_llvm:
12+
build_llvm_mac:
13+
name: Build LLVM
14+
runs-on: macos-14
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v3
18+
- run: "brew install ninja"
19+
# Build and package LLVM.
20+
- run: "./build-llvm-libs.sh llvm-static-libs-macos-14.tar.gz"
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
name: llvm-static-libs-macos-14
24+
path: llvm-static-libs-macos-14.tar.gz
25+
26+
build_llvm_linux:
1327
name: Build LLVM
1428
strategy:
1529
matrix:
16-
os: [ubuntu-20.04, ubuntu-24.04-arm, macos-14]
30+
os: [ubuntu-24.04, ubuntu-24.04-arm]
1731
runs-on: ${{ matrix.os }}
32+
container: ubuntu:20.04
33+
env:
34+
DEBIAN_FRONTEND: noninteractive
1835
steps:
1936
- name: checkout
2037
uses: actions/checkout@v3
21-
- if: contains(matrix.os, 'ubuntu')
22-
run: "sudo apt update && sudo apt install -y ninja-build"
23-
- if: contains(matrix.os, 'macos')
24-
run: "brew install ninja"
38+
- run: "apt update && apt install -y ninja-build gcc g++ git wget python3"
39+
# Install recent CMake.
40+
- run: |
41+
export ARCH=${{ runner.arch == 'x64' && 'x86_64' || 'aarch64' }}
42+
wget https://github.com/Kitware/CMake/releases/download/v3.31.5/cmake-3.31.5-linux-$ARCH.sh -O cmake-install.sh
43+
chmod +x cmake-install.sh
44+
./cmake-install.sh --skip-license --prefix=/usr/local
45+
rm cmake-install.sh
2546
# Build and package LLVM.
26-
- run: "./build-llvm-libs.sh llvm-static-libs-${{ matrix.os }}.tar.gz"
47+
- run: "./build-llvm-libs.sh llvm-static-libs-ubuntu-20.04-${{ runner.arch }}.tar.gz"
2748
- uses: actions/upload-artifact@v4
2849
with:
29-
name: llvm-static-libs-${{ matrix.os }}
30-
path: llvm-static-libs-${{ matrix.os }}.tar.gz
50+
name: llvm-static-libs-ubuntu-20.04-${{ runner.arch }}
51+
path: llvm-static-libs-ubuntu-20.04-${{ runner.arch }}.tar.gz
3152

3253
create_release:
3354
name: Create release
3455
runs-on: ubuntu-latest
35-
needs: [build_llvm]
56+
needs: [build_llvm_mac, build_llvm_linux]
3657
permissions:
3758
contents: write # for creating releases
3859
steps:

build-llvm-libs.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ then
1010
OUTPUT_FILE=$1
1111
fi
1212

13-
CC=clang
14-
CXX=clang++
15-
1613
ARCH=$(uname -m)
1714

1815
if [ "$ARCH" == "x86_64" ]; then

0 commit comments

Comments
 (0)