name: cmake on: push: branches: [ main ] pull_request: branches: [ main ] paths-ignore: - '.clang-format' - '.clangd' - '.gitignore' - 'LICENSE' - 'README.md' - '.github/workflows/xmake.yml' jobs: build: strategy: matrix: os: [ubuntu-24.04, windows-2022] runs-on: ${{ matrix.os }} steps: - name: Setup llvm & ninja if: matrix.os == 'windows-2022' uses: MinoruSekine/setup-scoop@v4.0.1 with: buckets: main apps: llvm ninja - 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 https://apt.llvm.org/llvm.sh chmod +x llvm.sh sudo ./llvm.sh 20 all 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-debug.tar.xz" | tar -xJ -C ./.llvm - name: Setup llvm binary if: matrix.os == 'windows-2022' run: | curl -O -L "https://github.com/clice-project/llvm-binary/releases/download/20.0.0/x64-windows-msvc-release.7z" 7z x x64-windows-msvc-release.7z "-o.llvm" - name: Setup msvc sysroot for cmake if: matrix.os == 'windows-2022' uses: ilammy/msvc-dev-cmd@v1 - name: Build clice (debug) if: matrix.os == 'ubuntu-24.04' run: | cmake --preset debug cmake --build --preset debug - name: Build clice (release) if: matrix.os == 'windows-2022' run: | cmake --preset release cmake --build --preset release - name: Run tests run: | ./build/bin/unit_tests --test-dir="./tests" --resource-dir="./.llvm/lib/clang/20"