diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..417de28 --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,35 @@ +name: CMake Build and Test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install dependencies + run: sudo apt-get update && sudo apt-get install -y cmake libboost-all-dev + + - name: Create build directory + run: mkdir -p build + + - name: Configure CMake + run: cmake -S . -B build + + - name: Build the project + run: cmake --build build + + - name: Run tests + run: ctest --test-dir build + + - name: Clean up + run: | + rm -rf build