60 lines
1.9 KiB
YAML
60 lines
1.9 KiB
YAML
name: cmake
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths-ignore:
|
|
- '.clang-format'
|
|
- '.clangd'
|
|
- '.gitignore'
|
|
- 'LICENSE'
|
|
- 'README.md'
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-24.04]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Setup llvm & libstdc++ & cmake & ninja
|
|
if: matrix.os == 'ubuntu-24.04'
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y software-properties-common
|
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
|
sudo apt update
|
|
sudo apt install -y gcc-14 g++-14 libstdc++-14-dev
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
|
|
sudo update-alternatives --set gcc /usr/bin/gcc-14
|
|
sudo update-alternatives --set g++ /usr/bin/g++-14
|
|
|
|
wget -O - https://apt.llvm.org/llvm.sh | sudo bash
|
|
sudo apt install -y llvm-18 llvm-18-tools clang-18 libclang-rt-18-dev lld-18
|
|
sudo ln -s /usr/bin/llvm-ar-18 /usr/bin/llvm-ar
|
|
sudo ln -s /usr/bin/llvm-ranlib-18 /usr/bin/llvm-ranlib
|
|
|
|
sudo apt install -y cmake ninja-build
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup llvm binary
|
|
if: matrix.os == 'ubuntu-24.04'
|
|
run: |
|
|
mkdir -p ./.llvm
|
|
curl -L "https://github.com/clice-project/llvm-binary/releases/download/20.0.0/x86_64-linux-gnu-release.tar.xz" | tar -xJ -C ./.llvm
|
|
|
|
- name: Build clice
|
|
run: |
|
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCLICE_ENABLE_TEST=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DLLVM_INSTALL_PATH="./.llvm"
|
|
cmake --build build
|
|
|
|
- name: Run tests
|
|
run: ./build/bin/unit_tests --test-dir="./tests" --resource-dir="./.llvm/lib/clang/20"
|