From 2fe7cc4642f295ed2aeca56e60d5bd08bc6b4505 Mon Sep 17 00:00:00 2001 From: Speeder Date: Wed, 15 Nov 2023 23:02:01 +0100 Subject: [PATCH] Added a test runner Github Action configuration --- .github/workflows/Tests.yml | 66 +++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/Tests.yml diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 0000000..1ee958f --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,66 @@ +# This action builds and runs CTest tests + +name: testable_singleton unit tests +on: + push: + branches: [ master ] + pull_request: + workflow_dispatch: # Manual execution +jobs: + test-ubuntu-gcc-latest: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + with: + submodules: true + - name: Configure and build the project + uses: threeal/cmake-action@v1.3.0 + with: + run-build: true + run-test: true + options: CMAKE_BUILD_TYPE=Release + test-args: -V + test-ubuntu-clang-latest: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + with: + submodules: true + - name: Configure and build the project + uses: threeal/cmake-action@v1.3.0 + with: + run-build: true + run-test: true + options: CMAKE_BUILD_TYPE=Debug + test-args: -V + c-compiler: clang + cxx-compiler: clang++ + test-windows-latest: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + with: + submodules: true + - name: Configure and build the project + uses: threeal/cmake-action@v1.3.0 + with: + run-build: true + run-test: true + options: CMAKE_BUILD_TYPE=Debug + test-args: -C Debug -V + test-macos-latest: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + with: + submodules: true + - name: Configure and build the project + uses: threeal/cmake-action@v1.3.0 + with: + run-build: true + run-test: true + test-args: -V diff --git a/README.md b/README.md index 437bb97..90d83ec 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![unit test status](https://github.com/Sp3EdeR/testable_singleton/actions/workflows/Tests.yml/badge.svg?branch=main)](https://github.com/Sp3EdeR/testable_singleton/actions/workflows/Tests.yml?query=branch%3Amain) + # Testable Singleton This header-only C++ library implements the [Singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern) in a thread-safe and efficient way.