diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..2319f7a --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,78 @@ +name: libakgl CI Build +run-name: ${{ gitea.actor }} libakgl test +on: [push] + +jobs: + cmake_build: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install build dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y \ + cmake gcc pkg-config \ + libasound2-dev libfreetype-dev libharfbuzz-dev \ + libpng-dev libtiff-dev libwebp-dev \ + libudev-dev libx11-dev libxcursor-dev libxext-dev \ + libxfixes-dev libxi-dev libxrandr-dev libxrender-dev \ + libxss-dev libxtst-dev + - name: Configure and build + run: | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug + cmake --build build --parallel + - name: Test (JUnit) + run: | + export LD_LIBRARY_PATH="$PWD/build:$PWD/build/deps/SDL:$PWD/build/deps/SDL_image:$PWD/build/deps/SDL_mixer:$PWD/build/deps/SDL_ttf" + ctest \ + --test-dir build \ + -E '^character$' \ + --output-on-failure \ + --output-junit "$(pwd)/ctest-junit.xml" + - name: Publish test results + if: always() + uses: mikepenz/action-junit-report@v4 + with: + report_paths: 'ctest-junit.xml' + annotate_only: true + detailed_summary: true + include_passed: true + fail_on_failure: 'true' + + mutation_test: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: recursive + - name: Install mutation-test dependencies + run: | + sudo apt-get update -y + sudo apt-get install -y \ + cmake gcc pkg-config python3 \ + libasound2-dev libfreetype-dev libharfbuzz-dev \ + libpng-dev libtiff-dev libwebp-dev \ + libudev-dev libx11-dev libxcursor-dev libxext-dev \ + libxfixes-dev libxi-dev libxrandr-dev libxrender-dev \ + libxss-dev libxtst-dev + # Keep CI bounded to a focused source file. Run the default target locally + # for the complete libakgl-owned src/ tree. + - name: Mutation testing + run: | + python3 scripts/mutation_test.py \ + --target src/staticstring.c \ + --junit mutation-junit.xml \ + --threshold 50 + - name: Publish mutation results + if: always() + uses: mikepenz/action-junit-report@v4 + with: + report_paths: 'mutation-junit.xml' + annotate_only: true + detailed_summary: true + include_passed: true + fail_on_failure: 'false'