Better error handling #50
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Amalgamate | |
if: ${{ matrix.for }} == "amalgamated" | |
run: | | |
make amalgamate | |
rm -r src/* tests/* # Get rid of current code | |
cp -r amalgamate/test/* . # Move the amalgamated version in its place (so later stuff works) | |
- name: Build | |
run: | | |
make tests debug | |
- 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 1>&2 || true | |
cat valgrind_output.txt | |
if ! tail -7 valgrind_output.txt | 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 |