From 4fad0cec595cca503ce863af2ded3bb7fe3a81d5 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sat, 27 Jun 2026 08:42:08 -0400 Subject: [PATCH] Add gitea workflow --- .gitea/workflows/ci.yaml | 23 +++++++++++++++++++++++ CMakeLists.txt | 7 +++++++ README.md | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..431afda --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,23 @@ +name: libakerror CI Build +run-name: ${{ gitea.actor }} libakerror test +on: [push] + +jobs: + cmake_build: + runs-on: ubuntu-latest + steps: + - run: echo "Triggered by ${{ gitea.event_name }} from ${{ gitea.repository }}@${{ gitea.ref }}. Building on ${{ runner.os }}." + - name: Check out repository code + uses: actions/checkout@v4 + - name: dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y cmake gcc moreutils + - name: build and test + run: | + mkdir installdir + cmake -S . -B build -DCMAKE_INSTALL_PREFIX=installdir + cmake --build build + cmake --install build + cmake --build build --target test + - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c0541a..37a6564 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ project(akerror LANGUAGES C) include(GNUInstallDirs) include(CMakePackageConfigHelpers) +include(CTest) set(AKERR_USE_STDLIB 1 CACHE BOOL "Use the C standard library") set(akerror_install_cmakedir "${CMAKE_INSTALL_LIBDIR}/cmake/akerror") @@ -52,6 +53,12 @@ add_test(NAME err_cleanup COMMAND test_err_cleanup) add_test(NAME err_trace COMMAND test_err_trace) add_test(NAME err_improper_closure COMMAND test_err_improper_closure) +set_tests_properties( + err_trace + err_improper_closure + PROPERTIES WILL_FAIL TRUE +) + target_link_libraries(test_err_catch PRIVATE akerror) target_link_libraries(test_err_cleanup PRIVATE akerror) target_link_libraries(test_err_trace PRIVATE akerror) diff --git a/README.md b/README.md index ea8570d..c790722 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This library provides a TRY/CATCH style exception handling mechanism for C. +![build badge](https://source.starfort.tech/andrew/libakerror/actions/workflows/ci.yaml/badge.svg?branch=main) + # Why? There is nothing wrong with C as it is. This library does not claim to fix some problem with C.