feat: implement cast
op for Cast
expression
#385
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
name: CMake Build and Test (Release Asserts) | |
runs-on: ubuntu-22.04 | |
env: | |
LLVM_SYMBOLIZER_PATH: /usr/lib/llvm-14/bin/llvm-symbolizer | |
steps: | |
- name: Compute substrait-mlir base path | |
run: | | |
echo "SUBSTRAIT_MLIR_MAIN_SRC_DIR=${GITHUB_WORKSPACE}/substrait-mlir" | tee -a $GITHUB_ENV | |
echo "SUBSTRAIT_MLIR_MAIN_BINARY_DIR=${GITHUB_WORKSPACE}/substrait-mlir/build" | tee -a $GITHUB_ENV | |
echo "LLVM_SYSPATH=${GITHUB_WORKSPACE}/substrait-mlir/build" | tee -a $GITHUB_ENV | |
echo "MLIR_RUNNER_UTILS_LIB=${GITHUB_WORKSPACE}/substrait-mlir/build/lib/libmlir_runner_utils.so" | tee -a $GITHUB_ENV | |
echo "MLIR_C_RUNNER_UTILS_LIB=${GITHUB_WORKSPACE}/substrait-mlir/build/lib/libmlir_c_runner_utils.so" | tee -a $GITHUB_ENV | |
- name: Set up Python | |
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # v4.3.0 | |
with: | |
python-version: 3.11 | |
- name: Cache git folder | |
uses: actions/cache@v4 | |
with: | |
path: substrait-mlir/.git | |
key: git-folder | |
- name: Install dependencies from apt | |
uses: awalsh128/cache-apt-pkgs-action@5902b33ae29014e6ca012c5d8025d4346556bd40 # v1.4.3 | |
with: | |
packages: protobuf-compiler libprotobuf-dev libcurl4-gnutls-dev | |
version: 1.0 | |
- name: Checkout project | |
uses: actions/checkout@v3 | |
with: | |
path: substrait-mlir | |
submodules: recursive | |
- name: Install Ninja | |
uses: llvm/actions/install-ninja@6a57890d0e3f9f35dfc72e7e48bc5e1e527cdd6c # Jan 17 | |
- name: Ccache for C++ compilation | |
uses: hendrikmuhs/ccache-action@53911442209d5c18de8a31615e0923161e435875 # v1.2.16 | |
with: | |
key: ${{ runner.os }}-substrait-mlir | |
# LLVM needs serious cache size | |
max-size: 6G | |
- name: Install Python depends | |
run: | | |
cd ${SUBSTRAIT_MLIR_MAIN_SRC_DIR} | |
python -m pip install -v -r requirements.txt | |
- name: Configure CMake | |
run: | | |
cmake \ | |
-DPython3_EXECUTABLE=$(which python) \ | |
-DBUILD_SHARED_LIBS=ON \ | |
-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \ | |
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ | |
-DCMAKE_C_COMPILER:FILEPATH=clang \ | |
-DCMAKE_CXX_COMPILER:FILEPATH=clang++ \ | |
-DLLVM_ENABLE_PROJECTS="mlir;clang;clang-tools-extra" \ | |
-DLLVM_TARGETS_TO_BUILD="Native" \ | |
-DLLVM_ENABLE_ASSERTIONS=ON \ | |
-DLLVM_INCLUDE_TESTS=OFF \ | |
-DLLVM_INCLUDE_UTILS=ON \ | |
-DLLVM_INSTALL_UTILS=ON \ | |
-DLLVM_LIT_ARGS=-v \ | |
-DLLVM_EXTERNAL_PROJECTS=substrait_mlir \ | |
-DLLVM_EXTERNAL_SUBSTRAIT_MLIR_SOURCE_DIR=${SUBSTRAIT_MLIR_MAIN_SRC_DIR} \ | |
-DLLVM_ENABLE_LLD=ON \ | |
-DLLVM_CCACHE_BUILD=ON \ | |
-DMLIR_INCLUDE_INTEGRATION_TESTS=ON \ | |
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \ | |
-DMLIR_ENABLE_PYTHON_BENCHMARKS=ON \ | |
-DSUBSTRAIT_MLIR_COMPILE_WARNING_AS_ERROR=ON \ | |
-S${SUBSTRAIT_MLIR_MAIN_SRC_DIR}/third_party/llvm-project/llvm \ | |
-B${SUBSTRAIT_MLIR_MAIN_BINARY_DIR} -G Ninja | |
echo "PYTHONPATH=${PYTHONPATH}:${SUBSTRAIT_MLIR_MAIN_BINARY_DIR}/tools/substrait_mlir/python_packages" | tee -a $GITHUB_ENV | |
- name: Build main project | |
run: | | |
cmake --build ${SUBSTRAIT_MLIR_MAIN_BINARY_DIR} --target substrait-mlir-all | |
ccache -s | |
- name: Run lit tests | |
run: | | |
cmake --build ${SUBSTRAIT_MLIR_MAIN_BINARY_DIR} --target check-substrait-mlir | |
# Run this as part of the `build` job because we need the `build` folder. | |
- name: Run pyright to test if typing annotations are correct | |
uses: jakebailey/pyright-action@v2 | |
with: | |
stats: true | |
working-directory: substrait-mlir | |
project: pyproject.toml |