From af2eaf7a99e61ad1acb9615b576ea54af5273bfb Mon Sep 17 00:00:00 2001 From: John McCardle Date: Fri, 10 Apr 2026 03:31:31 -0400 Subject: [PATCH] Add Gitea Actions CI workflow for automated testing, closes #285 Workflow runs on push to master and PRs: - build-and-test: release build + full test suite - debug-test: debug Python build + tests (catches refcount bugs) - asan-test: ASan/UBSan build + tests (PRs only) - valgrind-test: deep memory analysis (PRs only, 30min timeout) Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/ci.yaml | 123 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 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..76a04a2 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,123 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build-and-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential cmake git \ + zlib1g-dev libx11-dev libxrandr-dev libxcursor-dev \ + libfreetype-dev libudev-dev libvorbis-dev libflac-dev \ + libgl-dev libopenal-dev + + - name: Check for pre-built libraries + run: | + if [ ! -d "__lib" ]; then + echo "::error::__lib/ directory not found. Pre-built libraries must be available on the runner." + echo "See BUILD_FROM_SOURCE.md for instructions on building dependencies." + exit 1 + fi + + - name: Build (Release) + run: make linux + + - name: Run tests (Release) + run: cd tests && python3 run_tests.py -v + + debug-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential cmake git \ + zlib1g-dev libx11-dev libxrandr-dev libxcursor-dev \ + libfreetype-dev libudev-dev libvorbis-dev libflac-dev \ + libgl-dev libopenal-dev + + - name: Check for debug libraries + run: | + if [ ! -d "__lib_debug" ]; then + echo "::error::__lib_debug/ directory not found. Build debug Python first: tools/build_debug_python.sh" + exit 1 + fi + + - name: Build and test (debug Python) + run: make debug-test + + asan-test: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential cmake git \ + zlib1g-dev libx11-dev libxrandr-dev libxcursor-dev \ + libfreetype-dev libudev-dev libvorbis-dev libflac-dev \ + libgl-dev libopenal-dev + + - name: Check for debug libraries + run: | + if [ ! -d "__lib_debug" ]; then + echo "::error::__lib_debug/ directory not found. Build debug Python first: tools/build_debug_python.sh" + exit 1 + fi + + - name: Build and test (ASan + UBSan) + run: make asan-test + + valgrind-test: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential cmake git valgrind \ + zlib1g-dev libx11-dev libxrandr-dev libxcursor-dev \ + libfreetype-dev libudev-dev libvorbis-dev libflac-dev \ + libgl-dev libopenal-dev + + - name: Check for debug libraries + run: | + if [ ! -d "__lib_debug" ]; then + echo "::error::__lib_debug/ directory not found. Build debug Python first: tools/build_debug_python.sh" + exit 1 + fi + + - name: Build and test (Valgrind memcheck) + run: make valgrind-test + timeout-minutes: 30