Skip to content

Merge pull request #109 from AsPJT/feature-sim-update #242

Merge pull request #109 from AsPJT/feature-sim-update

Merge pull request #109 from AsPJT/feature-sim-update #242

name: CMakeUnitTest
on:
push:
branches: [ main, develop ]
pull_request:
env:
BUILD_TYPE: Debug
WORK_SPACE: ${{github.workspace}}/Projects
TEST_DIR: UnitTest
jobs:
build:
runs-on: ubuntu-20.04
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules
run: |
git submodule update --init --recursive ExternalLibrary/googletest
git submodule update --init --recursive ExternalLibrary/stb
- name: Install dependencies
run: |
sudo apt-get clean
sudo apt-get update
sudo apt-get install -y ninja-build libsfml-dev cmake
- name: Configure CMake
run: |
mkdir ${{github.workspace}}/build
cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -S ${{env.WORK_SPACE}}/${{env.TEST_DIR}} -GNinja
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target all -j 12
- name: Run tests
run: |
cd ${{github.workspace}}/build
ctest