Skip to content

[ReuseIR] adjust clone #413

[ReuseIR] adjust clone

[ReuseIR] adjust clone #413

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
version: [18, 20]
env:
RUSTFLAGS: "-Dwarnings"
MLIR_DIR: /usr/lib/llvm-${{matrix.version}}/lib/cmake/mlir/
LLVM_DIR: /usr/lib/llvm-${{matrix.version}}/
CXX: /usr/lib/llvm-${{matrix.version}}/bin/clang++
CC: /usr/lib/llvm-${{matrix.version}}/bin/clang
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install LLVM
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{matrix.version}} all
sudo apt-get install -y mlir-${{matrix.version}}-tools libmlir-${{matrix.version}}-dev ninja-build cmake libllvm${{matrix.version}}
## Fix LLVM issues
sudo sed -i 's/libLLVM.so.1/libLLVM.so/g' /usr/lib/llvm-${{matrix.version}}/lib/cmake/llvm/LLVMExports-relwithdebinfo.cmake
sudo touch "/usr/lib/llvm-${{matrix.version}}/lib/libLibcTableGenUtil.a"
- name: Install LLVM Lit
run: |
pip install lit
- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: ReuseIR Check
run: |
cmake -S reuse-mlir -B build -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
cmake --build build --target check --parallel
- name: Run Clippy
run: cargo clippy
- name: Run RustFmt
run: cargo fmt --check
- name: Run Rust Test
run: cargo test