Skip to content

feat(init): setup for 2024 #3

feat(init): setup for 2024

feat(init): setup for 2024 #3

Workflow file for this run

name: CMake
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
BUILD_TYPE: Release
BUILD_PROJECT: all
CC: gcc-11
CXX: g++-11
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Install ubuntu dependencies
run: sudo apt-get install ninja-build gcc-11 g++-11 libstdc++-11-dev clang-format
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Attempt to use cached dependencies
id: cache-python
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-tmp-${{ hashFiles('requirements.txt') }}
- name: Installing python dependencies
if: steps.cache-python.outputs.cache-hit != 'true'
run: pip install -r requirements.txt
- name: Attempt to use cached dependencies
id: cache-conan
uses: actions/cache@v2
with:
path: /home/runner/.conan
key: conan-cache-tmp-${{ hashFiles('conanfile.txt') }}-${{ env.BUILD_PROJECT }}
- name: Install conan dependencies
if: steps.cache-conan.outputs.cache-hit != 'true'
run: bash setup_build.sh
- name: Attempt to use cached build files
id: cache-cmake
uses: actions/cache@v2
with:
path: ${{github.workspace}}/build
key: cmake-cache-tmp-${{ hashFiles('CMakeLists.txt') }}-${{ env.BUILD_PROJECT }}
- name: Configure CMake
if: steps.cache-cmake.outputs.cache-hit != 'true'
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_PROJECT=${{env.BUILD_PROJECT}}
- name: Build
working-directory: ${{github.workspace}}/build
run: ninja all
- name: Test
working-directory: ${{github.workspace}}/build/bin
run: ./tests --success --use-colour=yes