Skip to content

Commit 5f6756f

Browse files
committed
Test with matrix
1 parent 45133ba commit 5f6756f

File tree

1 file changed

+22
-28
lines changed

1 file changed

+22
-28
lines changed

.github/workflows/simple.yml

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,40 +33,34 @@ jobs:
3333
- uses: actions/checkout@v4
3434
name: Checkout repository
3535

36-
- name: Run normal build and tests
37-
if: ${{ !matrix.force_fail }}
36+
- name: Run build and tests
3837
run: |
39-
# Build with matrix config
40-
${{ matrix.config }} ./scripts/build-wolfprovider.sh; BUILD_RESULT=$?
38+
# Build first with matrix config
39+
${{ matrix.config }} ${{ matrix.force_fail }} ./scripts/build-wolfprovider.sh || BUILD_RESULT=$?
4140
42-
# Run normal tests
43-
./scripts/cmd_test/do-cmd-tests.sh; TEST_RESULT=$?
41+
# Run all tests regardless of build result
42+
${{ matrix.force_fail }} ./scripts/cmd_test/do-cmd-tests.sh || TEST_RESULT=$?
4443
45-
# Check normal test results
46-
if [ $BUILD_RESULT -ne 0 ] || [ $TEST_RESULT -ne 0 ]; then
47-
echo "Normal build/test failed unexpectedly"
48-
exit 1
49-
fi
50-
51-
- name: Run force-fail build and tests
52-
if: ${{ matrix.force_fail }}
53-
run: |
54-
# Build with matrix config and force fail
55-
${{ matrix.config }} WOLFPROV_FORCE_FAIL=1 ./scripts/build-wolfprovider.sh; BUILD_RESULT=$?
56-
57-
# Run tests with force fail
58-
WOLFPROV_FORCE_FAIL=1 ./scripts/cmd_test/do-cmd-tests.sh; TEST_RESULT=$?
59-
60-
# Check force-fail results - we expect failures
61-
if [ $BUILD_RESULT -eq 0 ] || [ $TEST_RESULT -eq 0 ]; then
62-
echo "Force-fail build/test unexpectedly succeeded"
63-
exit 1
44+
# For force_fail, we expect failures (return 1)
45+
if [ -n "${{ matrix.force_fail }}" ]; then
46+
if [ $BUILD_RESULT -eq 0 ] || [ $TEST_RESULT -eq 0 ]; then
47+
echo "Build/Test unexpectedly succeeded with force fail enabled"
48+
exit 1 # failure was not seen when expected
49+
else
50+
echo "Build/Test failed as expected with force fail enabled"
51+
exit 0 # expected failure occurred
52+
fi
6453
else
65-
echo "Force-fail build/test failed as expected"
66-
exit 0
54+
# Normal case - expect success
55+
if [ $BUILD_RESULT -ne 0 ] || [ $TEST_RESULT -ne 0 ]; then
56+
exit 1 # unexpected failure
57+
fi
6758
fi
6859
6960
- name: Print test logs
7061
if: always()
7162
run: |
72-
[ -f test-suite.log ] && cat test-suite.log
63+
if [ -f test-suite.log ] ; then
64+
cat test-suite.log
65+
fi
66+

0 commit comments

Comments
 (0)