Skip to content

perf: dedup masked-variable atoms in FlattenComplexAtoms (#41) #179

perf: dedup masked-variable atoms in FlattenComplexAtoms (#41)

perf: dedup masked-variable atoms in FlattenComplexAtoms (#41) #179

Workflow file for this run

name: CI
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
cc: gcc-14
cxx: g++-14
name: Linux GCC
release_only: true
- os: ubuntu-24.04
cc: clang-22
cxx: clang++-22
name: Linux Clang
release_only: false
- os: macos-15
cc: clang
cxx: clang++
name: macOS
release_only: true
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: ${{ !matrix.release_only || startsWith(github.ref, 'refs/tags/v') }}
with:
persist-credentials: false
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && (!matrix.release_only || startsWith(github.ref, 'refs/tags/v'))
run: |
wget -qO llvm.sh https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 22 all
sudo apt-get install -y -qq libz3-dev ninja-build
echo "LLVM_DIR=/usr/lib/llvm-22/lib/cmake/llvm" >> "$GITHUB_ENV"
- name: Install dependencies (macOS)
if: runner.os == 'macOS' && (!matrix.release_only || startsWith(github.ref, 'refs/tags/v'))
run: |
brew install llvm z3 ninja
LLVM_PREFIX="$(brew --prefix llvm)"
echo "${LLVM_PREFIX}/bin" >> "$GITHUB_PATH"
{
echo "LLVM_DIR=${LLVM_PREFIX}/lib/cmake/llvm"
echo "CC=${LLVM_PREFIX}/bin/clang"
echo "CXX=${LLVM_PREFIX}/bin/clang++"
echo "LDFLAGS=-L${LLVM_PREFIX}/lib/c++ -Wl,-rpath,${LLVM_PREFIX}/lib/c++"
} >> "$GITHUB_ENV"
- name: Log tool versions
if: ${{ !matrix.release_only || startsWith(github.ref, 'refs/tags/v') }}
run: |
"${CC:-${{ matrix.cc }}}" --version
cmake --version
ninja --version
- name: Cache dependencies
if: ${{ !matrix.release_only || startsWith(github.ref, 'refs/tags/v') }}
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: build-deps/install
key: deps-${{ matrix.os }}-${{ matrix.cc }}-${{ hashFiles('dependencies/*.cmake') }}
- name: Build dependencies
if: ${{ !matrix.release_only || startsWith(github.ref, 'refs/tags/v') }}
run: |
cmake -S dependencies -B build-deps -G Ninja \
-DCMAKE_C_COMPILER="${CC:-${{ matrix.cc }}}" \
-DCMAKE_CXX_COMPILER="${CXX:-${{ matrix.cxx }}}" \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_EXTERNAL_LLVM=ON \
-DCOBRA_BUILD_TESTS=ON
cmake --build build-deps
- name: Build CoBRA
if: ${{ !matrix.release_only || startsWith(github.ref, 'refs/tags/v') }}
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER="${CC:-${{ matrix.cc }}}" \
-DCMAKE_CXX_COMPILER="${CXX:-${{ matrix.cxx }}}" \
-DCMAKE_PREFIX_PATH="$(pwd)/build-deps/install" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS_INIT="-march=native" \
-DCOBRA_BUILD_TESTS=ON \
-DCOBRA_BUILD_LLVM_PASS=ON
cmake --build build
- name: Run tests
if: ${{ !matrix.release_only || startsWith(github.ref, 'refs/tags/v') }}
run: ctest --test-dir build -j "$(nproc 2>/dev/null || sysctl -n hw.ncpu)" --output-on-failure -E "DatasetBenchmark|SiMBADataset|SiMBAExprDataset|GAMBADataset|OSESDataset|ObfuscatorXDataset"
lint:
name: Lint
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install clang-format
run: |
wget -qO llvm.sh https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 22 all
- name: clang-format check
run: |
find include lib tools \( -name '*.h' -o -name '*.cpp' \) -print0 \
| xargs -0 clang-format-22 --dry-run --Werror