ci(llvm): add ny-llvmc object generation workflow (crate path) using hello_simple_llvm sample

This commit is contained in:
Selfhosting Dev
2025-09-17 22:25:44 +09:00
parent d992fa1d2d
commit b6ad86f087
2 changed files with 56 additions and 0 deletions

49
.github/workflows/llvm-ny-llvmc-obj.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: llvm-ny-llvmc-obj
on:
push:
branches: [ main, master, "**" ]
pull_request:
branches: [ "**" ]
jobs:
ny-llvmc-obj:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust (stable)
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Install LLVM 18 and Python deps
run: |
sudo apt-get update
sudo apt-get install -y curl ca-certificates lsb-release wget gnupg python3-pip
curl -fsSL https://apt.llvm.org/llvm.sh -o llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
llvm-config-18 --version
python3 -m pip install --upgrade pip
python3 -m pip install llvmlite
- name: Build nyash (release)
run: cargo build --release -j 2
- name: Generate object via ny-llvmc (crate path)
env:
NYASH_LLVM_COMPILER: crate
NYASH_LLVM_ONLY_OBJ: "1"
run: |
bash tools/build_llvm.sh apps/tests/hello_simple_llvm.nyash -o app
ls -la target/aot_objects
test -f target/aot_objects/hello_simple_llvm.o
- name: Print object file type
run: |
file target/aot_objects/hello_simple_llvm.o || true