Skip to content

Add Bennet to README (#496) #1487

Add Bennet to README (#496)

Add Bennet to README (#496) #1487

Workflow file for this run

# Check style of codebase
name: Style
on:
pull_request:
push:
branches:
- main
jobs:
ocaml-format:
strategy:
matrix:
version: [4.14.1]
name: OCamlFormat
runs-on: ubuntu-24.04
steps:
- name: Checkout CN
uses: actions/checkout@v4
- name: Install OPAM
run: sudo apt-get install opam
- name: Restore OPAM cache
id: cache-opam-restore
uses: actions/cache/restore@v4
with:
path: ~/.opam
key: ${{ matrix.version }}-${{ hashFiles('cn.opam') }}
- name: Setup OPAM
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
run: |
opam init --yes --no-setup --shell=sh --compiler=${{ matrix.version }}
eval $(opam env --switch=${{ matrix.version }})
opam repo add --yes --this-switch coq-released https://coq.inria.fr/opam/released
opam install --deps-only --with-test --yes ./cn.opam z3
- name: Save OPAM cache
uses: actions/cache/save@v4
if: steps.cache-opam-restore.outputs.cache-hit != 'true'
with:
path: ~/.opam
key: ${{ matrix.version }}-${{ hashFiles('cn.opam') }}
- name: Install OCamlFormat
run: |
eval $(opam env --switch=${{ matrix.version }})
opam install --yes ocamlformat.0.27.0
- name: Check CN code formatting
run: |
eval $(opam env --switch=${{ matrix.version }})
dune build @fmt
clang-format:
name: ClangFormat
runs-on: ubuntu-24.04
steps:
- name: Checkout CN
uses: actions/checkout@v4
- name: Install ClangFormat
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main"
sudo add-apt-repository "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main"
sudo apt-get update
sudo apt-get install clang-format-19
- name: Check LibCN code formatting
run: |
find runtime/libcn/ -iname '*.h' -o -iname '*.c' -o -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format-19 --dry-run -Werror
c-warnings:
strategy:
matrix:
compiler: [gcc, clang-19]
name: C compiler warnings
runs-on: ubuntu-24.04
steps:
- name: Checkout CN
uses: actions/checkout@v4
- name: Install GCC
if: ${{ matrix.compiler == 'gcc' }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc
- name: Install Clang
if: ${{ matrix.compiler == 'clang-19' }}
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main"
sudo add-apt-repository "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main"
sudo apt-get update
sudo apt-get install clang-19
- name: Check compiler warnings
run: |
find runtime/libcn/ -iname '*.c' -exec ${{ matrix.compiler }} -c -I runtime/libcn/include/ -Werror -Wall -o /dev/null {} ';'
- name: Check C++ compatibility
run: |
${{ matrix.compiler }} -std=c++17 -Iruntime/libcn/include/ runtime/libcn/check_compat.cpp
shellcheck:
name: ShellCheck
runs-on: ubuntu-24.04
steps:
- name: Checkout CN
uses: actions/checkout@v4
- name: Install ShellCheck
run: sudo apt-get install shellcheck
- name: Check test scripts
run: shellcheck -S error tests/**/*.sh