[runtime] Add basic xDSL kernel compilation example (#5) #40
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: Builds | |
permissions: | |
contents: read | |
actions: write | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install minimum required cmake and ninja | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: "~3.21.0" | |
- name: Install CCache | |
uses: Chocobo1/setup-ccache-action@v1 | |
with: | |
ccache_options: | | |
max_size=400M | |
compiler_check=none | |
- name: Install Compiler | |
run: | | |
sudo apt-get update | |
sudo apt-get install lld clang | |
- name: Install Python dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Install bender | |
uses: baptiste0928/cargo-install@v3 | |
with: | |
crate: bender | |
version: '~0.28.0' | |
- name: Install Pulp Toolchain | |
run: | | |
mkdir ${{github.workspace}}/pulp-toolchain | |
wget -qO- https://github.com/pulp-platform/llvm-project/releases/download/0.12.0/riscv32-pulp-llvm-ubuntu2004-0.12.0.tar.gz \ | |
| tar --strip-components=1 -xzv -C ${{github.workspace}}/pulp-toolchain | |
- name: Configure Compiler | |
run: | | |
cmake -G Ninja -B ${{github.workspace}}/codegen/build \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_C_COMPILER=clang \ | |
-DCMAKE_CXX_COMPILER=clang++ \ | |
-DCMAKE_C_COMPILER_LAUNCHER=ccache \ | |
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | |
-DIREE_ENABLE_ASSERTIONS=ON \ | |
-DIREE_ENABLE_LLD=ON \ | |
-DIREE_ENABLE_THIN_ARCHIVES=ON \ | |
-DPULP_CLANG_PATH=${{github.workspace}}/pulp-toolchain/bin/clang \ | |
-S ${{github.workspace}}/codegen | |
- name: Build and Test Compiler | |
run: cmake --build ${{github.workspace}}/codegen/build --target check-quidditch | |
- name: Download Quidditch Toolchain | |
run: | | |
mkdir ./toolchain | |
docker run --rm ghcr.io/opencompl/quidditch/toolchain:main tar -cC /opt/quidditch-toolchain . \ | |
| tar -xC ./toolchain | |
- name: Configure Runtime | |
run: | | |
cmake -GNinja -Bquidditch-runtime-build \ | |
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchain/ToolchainFile.cmake \ | |
-DPULP_CLANG_PATH=${{github.workspace}}/pulp-toolchain/bin/clang \ | |
-S ${{github.workspace}}/runtime | |
- name: Build Runtime | |
run: cmake --build quidditch-runtime-build | |
- name: Test Runtime | |
working-directory: ${{github.workspace}}/quidditch-runtime-build | |
run: ctest --extra-verbose -j$(nproc) |