ci(llvm): add ny-llvmc object generation workflow (crate path) using hello_simple_llvm sample
This commit is contained in:
49
.github/workflows/llvm-ny-llvmc-obj.yml
vendored
Normal file
49
.github/workflows/llvm-ny-llvmc-obj.yml
vendored
Normal 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
|
||||||
|
|
||||||
7
apps/tests/hello_simple_llvm.nyash
Normal file
7
apps/tests/hello_simple_llvm.nyash
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
static box Main {
|
||||||
|
main() {
|
||||||
|
print(42)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user