Skip to content

Commit 2a7c40c

Browse files
authored
ci: support python binding build (#168)
1 parent a589eb7 commit 2a7c40c

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/build-llvm.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions: read-all
88
jobs:
99
build:
1010
name: Build
11-
runs-on: [self-hosted]
11+
runs-on: [self-hosted, 0.0.1]
1212

1313
steps:
1414
- uses: actions/checkout@v4
@@ -24,8 +24,9 @@ jobs:
2424

2525
- name: Build
2626
run: |
27+
python3 -m pip install -r mlir/python/requirements.txt
2728
mkdir llvm-install
28-
cmake -G Ninja llvm -B build -DCMAKE_INSTALL_PREFIX=llvm-install \
29+
cmake -G Ninja llvm -B build -DCMAKE_INSTALL_PREFIX=llvm-install -DMLIR_ENABLE_BINDINGS_PYTHON=ON -DPython3_EXECUTABLE=$(which python3) \
2930
-DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=true -DLLVM_ENABLE_PROJECTS="mlir" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_INSTALL_UTILS=true -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_INSTALL_GTEST=ON
3031
cmake --build build --target install
3132
cd llvm-install

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323

24+
- name: Set LLVM hash
25+
run: |
26+
echo LLVM_HASH=$(cat cmake/llvm-version.txt) >>$GITHUB_ENV
27+
28+
- name: Fetch requirements for python binding
29+
uses: actions/checkout@v4
30+
with:
31+
repository: llvm/llvm-project
32+
ref: ${{ env.LLVM_HASH }}
33+
sparse-checkout: mlir/python/requirements.txt
34+
sparse-checkout-cone-mode: false
35+
path: llvm-dep
36+
37+
- name: Install requirements
38+
run: python3 -m pip install -r llvm-dep/mlir/python/requirements.txt
39+
2440
- name: Build
2541
run: |
2642
scripts/compile.sh

0 commit comments

Comments
 (0)