Skip to content

Add release workflow #20

Add release workflow

Add release workflow #20

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
for: ["regular", "amalgamated"]
name: Tests (${{ matrix.for }})
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install clang & valgrind
run: |
sudo apt-get update
sudo apt-get install -y clang valgrind
- name: Build
run: |
if [ "${{ matrix.for }}" == "regular" ]; then
make tests debug
elif [ "${{ matrix.for }}" == "amalgamated" ]; then
make clean
make amalgamate
rm -r src/*
mv amalgamate/caught.c src/lib.c
mv amalgamate/caught.h src/lib.h
sed -i 's/#include "caught.h"/#include "lib.h"/' src/lib.c # change name to what tests expect
make tests debug
fi
- name: Run tests (debug)
run: |
bin/tests-debug
- name: Run tests (optimized)
run: |
bin/tests
- name: Run tests (valgrind)
run: |
valgrind bin/tests-debug 2> valgrind_output.txt || true
cat valgrind_output.txt
if ! grep -q "All heap blocks were freed -- no leaks are possible" valgrind_output.txt; then
exit 1; # exit if not found, we need this check because valgrind exit codes are bad
fi