From 23b8dca3e9822cee6311ec5f81c652f871a2bdf5 Mon Sep 17 00:00:00 2001 From: Kait Lam Date: Wed, 24 Jul 2024 15:39:44 +1000 Subject: [PATCH] ci: add offline c++ lifter syntax checking (#101) * ci: add offline c++ lifter syntax checking * use ubuntu 24.04 for llvm 17 * allow LLVM 16 * use llvm 17 * install ninja * ci: only run opam on opam.yml changes --- .github/workflows/opam.yml | 4 ++-- .github/workflows/test.yml | 23 +++++++++++++++++++ .../subprojects/aslp-lifter-llvm/meson.build | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index c0298aef..8b95df3b 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -3,9 +3,9 @@ name: Build with opam on: push: branches: [ partial_eval ] - paths: [ '*.opam', '.github/**' ] + paths: [ '*.opam', '.github/workflows/opam.yml' ] pull_request: - paths: [ '*.opam', '.github/**' ] + paths: [ '*.opam', '.github/workflows/opam.yml' ] workflow_dispatch: # only run one instance of this action at a time. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30f14095..38f4d39c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,3 +58,26 @@ jobs: - run: dune build offlineASL -j4 - run: dune build @offline-coverage -j4 + + offline-cpp: + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + + - uses: cachix/install-nix-action@v25 + - run: echo 'preparing nix shell environment' + + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - run: python -m pip install 'meson~=1.4.0' 'ninja' + + - run: dune build --profile release + - run: echo ':gen A64 .* cpp' | OCAMLRUNPARAM=b dune exec asli + + - run: LLVM_CONFIG=$(which llvm-config-17) offlineASL-cpp/check.py + + - name: 'syntax check generated C++ lifter' + run: meson compile -C offlineASL-cpp/build diff --git a/offlineASL-cpp/subprojects/aslp-lifter-llvm/meson.build b/offlineASL-cpp/subprojects/aslp-lifter-llvm/meson.build index f872ed12..c6768e0c 100644 --- a/offlineASL-cpp/subprojects/aslp-lifter-llvm/meson.build +++ b/offlineASL-cpp/subprojects/aslp-lifter-llvm/meson.build @@ -3,7 +3,7 @@ project('aslp-lifter-llvm', 'cpp', default_options : [ 'warning_level=3', 'cpp_std=c++20' ]) version = meson.project_version() -llvm_dep = dependency('llvm', version: ['>=17', '<18']) +llvm_dep = dependency('llvm', version: ['>=16', '<18']) empty_dep = dependency('', required: false) lifter_dep = dependency('aslp-lifter', version: version, fallback: ['aslp-lifter', 'gen_dep'])