From b44d94ac430d4c55485ca931065d4d83bc676fe6 Mon Sep 17 00:00:00 2001 From: Knut Morten Okstad Date: Thu, 22 Oct 2026 07:18:29 +0200 Subject: [PATCH] Add workflow running the unit tests --- .github/workflows/run-test.yml | 47 ++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/run-test.yml diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml new file mode 100644 index 0000000..8eef10a --- /dev/null +++ b/.github/workflows/run-test.yml @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: 2023 SAP SE +# +# SPDX-License-Identifier: Apache-2.0 +# +# This file is part of FEDEM - https://openfedem.org + +name: Unit testing + +on: + pull_request: + branches: + - main + + workflow_dispatch: + +jobs: + build-and-test: + name: Build and execute unit tests + + runs-on: ubuntu-22.04 + + steps: + - name: Silence some advice and hint + run: | + git config --global advice.detachedHead false + git config --global init.defaultBranch main + + - name: Check out source repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Download the pFUnit-3 package + uses: robinraju/release-downloader@v1 + with: + repository: openfedem/fedem-foundation + fileName: 'pFUnit3_Ubuntu-22.04.tar.gz' + latest: true + extract: true + + - name: Configure main build + run: > + PFUNIT=${{ github.workspace }}/pFUnit3 + cmake -B ./build -DCMAKE_BUILD_TYPE=Release -DBUILD_SPR_INTEGER8=OFF + + - name: Build binaries and execute tests + run: cmake --build ./build --target check diff --git a/README.md b/README.md index 962a93b..d1e6642 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ ---> [![REUSE status](https://api.reuse.software/badge/github.com/openfedem/sam-lib)](https://api.reuse.software/info/github.com/openfedem/sam-lib) +[![Test status](https://github.com/openfedem/samm-lib/actions/workflows/run_test.yml/badge.svg)](https://github.com/openfedem/sam-lib/actions/workflows/run_test.yml) # The SAM Fortran library