From b593b4920c8c766bf265a209d8a329c28f53fe94 Mon Sep 17 00:00:00 2001 From: emilcode Date: Tue, 2 Sep 2025 15:33:08 +0000 Subject: [PATCH 1/3] [added] github action building and running unit tests --- .github/workflows/build-test.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..1e115a7 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,39 @@ +name: Tests + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository_owner }}/embedded-lib-dev:latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check environment + run: | + cmake --version + gcc --version + + - name: Create build directory + run: mkdir build + working-directory: ./build + + - name: Configure CMake + run: cmake -DTARGET_GROUP=test .. + working-directory: ./build + + - name: Build tests + run: cmake --build . + working-directory: ./build + + - name: Run tests + run: ctest --output-on-failure + working-directory: ./build \ No newline at end of file From 6bf04ef3debd7632b7c87c9d1c7224ee9a139f38 Mon Sep 17 00:00:00 2001 From: emilcode Date: Tue, 2 Sep 2025 15:35:59 +0000 Subject: [PATCH 2/3] [added] start action also on pull requests into main --- .github/workflows/build-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 1e115a7..cc00bdf 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + branches: + - main workflow_dispatch: jobs: From e1f5841d842e250c6e45d8b90fec6b0bf813f5bc Mon Sep 17 00:00:00 2001 From: emilcode Date: Tue, 2 Sep 2025 15:40:08 +0000 Subject: [PATCH 3/3] [fixed] github action for unittests: build dir has to be generated first --- .github/workflows/build-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index cc00bdf..a04bf7e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - build-and-publish: + build-and-test: runs-on: ubuntu-latest container: image: ghcr.io/${{ github.repository_owner }}/embedded-lib-dev:latest @@ -27,7 +27,6 @@ jobs: - name: Create build directory run: mkdir build - working-directory: ./build - name: Configure CMake run: cmake -DTARGET_GROUP=test ..