# Gitea Actions workflow (not GitHub Actions — this project is hosted on # Gitea, see CONTRIBUTING.md). Gitea Actions' YAML is GitHub-Actions- # compatible, but two things here are Gitea-specific and need to match # your actual instance, not just this repo: # - `runs-on: ubuntu-latest` must match a label your registered Gitea # runner (act_runner) actually advertises; there is no GitHub-hosted- # runner equivalent, this is entirely self-hosted. # - `uses: actions/checkout@v4` resolves against whatever action source # your instance's runner is configured with (by default, Gitea Actions # fetches actions from github.com unless DEFAULT_ACTIONS_URL is # overridden); use `https://gitea.com/actions/checkout@v4` instead if # your runner is configured to disallow GitHub as an action source. name: CI on: push: pull_request: jobs: build-and-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Build static + shared library run: make all - name: Run test suite run: make test - name: Build and run under AddressSanitizer + UndefinedBehaviorSanitizer run: | mkdir -p build/san for f in src/*.c; do cc -std=c11 -Wall -Wextra -O1 -g -fPIC -Iinclude -Isrc -D_GNU_SOURCE \ -fsanitize=address,undefined -c "$f" -o "build/san/$(basename "${f%.c}").o" done for t in tests/test_*.c; do name=$(basename "${t%.c}") cc -std=c11 -O1 -g -Iinclude -Isrc -D_GNU_SOURCE -fsanitize=address,undefined \ "$t" build/san/*.o -lpthread -o "build/san/$name" "./build/san/$name" done - name: Build and run under ThreadSanitizer run: | mkdir -p build/tsan for f in src/*.c; do cc -std=c11 -Wall -Wextra -O1 -g -fPIC -Iinclude -Isrc -D_GNU_SOURCE \ -fsanitize=thread -c "$f" -o "build/tsan/$(basename "${f%.c}").o" done for t in tests/test_*.c; do name=$(basename "${t%.c}") cc -std=c11 -O1 -g -Iinclude -Isrc -D_GNU_SOURCE -fsanitize=thread \ "$t" build/tsan/*.o -lpthread -o "build/tsan/$name" "./build/tsan/$name" done