Skip to content

Commit

Permalink
Convert workflow to matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy-Gonzalez committed Feb 3, 2024
1 parent d6f204c commit 214cd27
Showing 1 changed file with 17 additions and 29 deletions.
46 changes: 17 additions & 29 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:

jobs:
tests:
strategy:
matrix:
for: ["regular", "amalgamated"]
name: Tests (${{ matrix.for }})
runs-on: ubuntu-latest

steps:
Expand All @@ -24,43 +28,27 @@ jobs:
- name: Build
run: |
make tests debug
- name: Run debug
run: |
bin/tests-debug
- name: Run optimized
run: |
bin/tests
- name: Run w/ 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
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: Build amalgamated
run: |
make clean
make amalgamate
rm -r src/*
mv amalgamate/caught.h src/lib.h
mv amalgamate/caught.c src/lib.c
sed -i 's/#include "caught.h"/#include "lib.h"/' src/lib.c # change name to what tests expect
make tests debug
- name: Run amalgamated debug
- name: Run tests (debug)
run: |
bin/tests-debug
- name: Run amalgamated optimized
- name: Run tests (optimized)
run: |
bin/tests
- name: Run amalgamated w/ valgrind
- name: Run tests (valgrind)
run: |
valgrind bin/tests-debug 2> valgrind_output.txt || true
cat valgrind_output.txt
Expand Down

0 comments on commit 214cd27

Please sign in to comment.