From c7cdd054c442158b4aadcd896dd559b49d143fa7 Mon Sep 17 00:00:00 2001 From: Roman Pavelka Date: Fri, 14 Jul 2023 15:21:30 +0200 Subject: [PATCH] Add github actions with basic CI --- .github/workflows/learn-github-actions.yml | 26 ++++++++++++++++++++++ README.md | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/learn-github-actions.yml diff --git a/.github/workflows/learn-github-actions.yml b/.github/workflows/learn-github-actions.yml new file mode 100644 index 0000000..0e89c7d --- /dev/null +++ b/.github/workflows/learn-github-actions.yml @@ -0,0 +1,26 @@ +name: Build +on: + push: +jobs: + build-project: + runs-on: ubuntu-latest + strategy: + matrix: + build-tool: [Unix Makefiles, Ninja] + compiler: [g++, clang++] + steps: + - name: Checkout the repository + uses: actions/checkout@v3.5.3 + + - name: Configure the project + uses: threeal/cmake-action@v1.2.0 + with: + build-dir: build_${{ matrix.build-tool }}_${{ matrix.compiler }} + generator: ${{ matrix.build-tool }} + cxx-compiler: ${{ matrix.compiler }} + + - name: Build the project + run: cmake --build "build_${{ matrix.build-tool }}_${{ matrix.compiler }}" + + - name: Test the project + run: ctest --test-dir "build_${{ matrix.build-tool }}_${{ matrix.compiler }}" diff --git a/README.md b/README.md index ff43f8d..5ddc9f2 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Check commits one-by-one as they: 1. start with not using CMake at all and building the thing using plain g++, 1. use the simplest CMake 1. Hide the growing complexity to Makefile +1. Adds configure, build and test to GitHub pipeline. ### TODO