From 37855f6b1797da092875462f3b50cd9025151727 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 9 Dec 2025 08:42:34 +0100 Subject: [PATCH] adds github action --- .github/workflows/unit-tests.yml | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..a3531e9 --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,58 @@ +name: CI Unit Tests + +on: + push: + paths: + - '**.cpp' + - '**.h' + - '**CMakeLists.txt' + - '.github/workflows/**' + - 'conanfile.py' + pull_request: + paths: + - '**.cpp' + - '**.h' + - '**CMakeLists.txt' + - '.github/workflows/**' + - 'conanfile.py' + +jobs: + unit-tests: + name: unit-tests (C++20) + runs-on: ubuntu-latest + steps: + - name: Checkout SystemC-Components-Test + uses: actions/checkout@v6 + with: + submodules: true + - name: Checkout SystemC-Components + uses: actions/checkout@v6 + with: + repository: Minres/SystemC-Components + path: scc + submodules: true + - name: Cache Conan + uses: actions/cache@v4 + with: + path: ~/.conan2 + key: conan-${{ runner.os }}-unit-cpp20-${{ hashFiles('conanfile.py') }} + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y g++ python3-pip cmake ninja-build + pip3 install conan --break-system-packages + cmake --version + + - name: Configure + run: > + cmake --preset Debug -B build + -DBUILD_TESTING=ON + -DCMAKE_CXX_STANDARD=20 + + - name: Build + run: cmake --build build -j + + - name: Run unit tests + run: ctest --output-on-failure + working-directory: build \ No newline at end of file