Skip to content

Implement CMake build system #1736

Implement CMake build system

Implement CMake build system #1736

Workflow file for this run

name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Install packages
run: sudo apt install -y --no-install-recommends zlib1g-dev pkg-config libgmp-dev curl ninja-build
- name: Check out repository code
uses: actions/checkout@HEAD
with:
submodules: true
- name: Ensure pre-commit checks pass
run: python3 -m pip install pre-commit && pre-commit run --all-files --show-diff-on-failure --color=always
- name: Install sail from binary
run: |
sudo mkdir -p /usr/local
curl --location https://github.com/rems-project/sail/releases/download/0.18-linux-binary/sail.tar.gz | sudo tar xvz --directory=/usr/local --strip-components=1
- name: Build and test simulators
run: |
mkdir build
cd build
# Ninja is used because the CMake Makefile generator doesn't
# build top-level targets in parallel unfortunately.
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
# By default only the rv32d and rv64d emulators are build,
# but we want to build more targets here to ensure they
# can at least build without errors.
ninja c_emulator_rv32d c_emulator_rv64d c_emulator_rv32d_rvfi generated_smt_rv64f
# These are broken: generated_rmem_rv32d_rmem generated_coq_rv64f_coq
ctest --output-junit text.xml
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: tests.xml
path: build/tests.xml
- name: Upload event payload
if: always()
uses: actions/upload-artifact@v4
with:
name: event.json
path: ${{ github.event_path }}