Create cmake.yml #25
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and test | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set test environment variables | |
run: | | |
echo "TM_SETTINGS_DIRECTORY=$PWD/settings" >> "$GITHUB_ENV" | |
echo "TM_TEST_DIRECTORY=$PWD/test" >> "$GITHUB_ENV" | |
- name: Get boost | |
run: | | |
wget https://boostorg.jfrog.io/artifactory/main/release/1.84.0/source/boost_1_84_0.tar.bz2 | |
tar xf boost_1_84_0.tar.bz2 | |
mkdir -p boost/include | |
ln -s $PWD/boost_1_84_0/boost boost/include/boost | |
- name: Install clang dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install mold libtbb-dev | |
- name: Install clang | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod u+x llvm.sh | |
sudo ./llvm.sh 18 all | |
- uses: lukka/get-cmake@latest | |
- name: Pull dependencies | |
run: git submodule update --init | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug -G"Ninja" -DCMAKE_CXX_COMPILER="clang++-18" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" -DBOOST_ROOT="boost" | |
- name: Build | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/build | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest -C Debug --output-on-failure |