From a5c66cf7eff3b683eb827dc5c1539f690d05a502 Mon Sep 17 00:00:00 2001 From: qpxdesign Date: Sat, 2 Mar 2024 18:49:55 -0500 Subject: [PATCH] add github actions (5) --- .github/workflows/run-tests.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9389f58..c541df6 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,9 +9,22 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Build project run: cargo build -r --verbose - name: Run Tests - run: cd tests && cargo run + id: run_tests + run: | + result=$(cd tests && cargo run) + echo "::set-output name=result::$result" + + - name: Parse test results + run: | + echo "${{ steps.run_tests.outputs.result }}" | while read -r line; do + if [[ $line == *"Passed!"* ]]; then + echo "Test ${line#*#} - Passed" + else + echo "Test ${line#*#} - Failed" + exit 1 + fi + done