Skip to content

Commit

Permalink
Merge pull request #613 from mkurz/make_test_script_fail
Browse files Browse the repository at this point in the history
Make `test.sh` script fail when any command fails
  • Loading branch information
mkurz authored Apr 29, 2024
2 parents 35e1e8a + eca2f02 commit 992e8d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ jobs:
needs: changes
if: ${{ (github.event_name != 'pull_request' && !failure() && !cancelled()) || contains(fromJSON(needs.changes.outputs.samples), 'java-grpc')}}
with:
java: 17, 21
# Can't test with Java 21+ currently because of https://github.com/lightbend/ssl-config/issues/367
java: 17
scala: 2.13.x, 3.x
gradle-build-root: play-java-grpc-example
add-dimensions: >-
Expand Down Expand Up @@ -362,7 +363,8 @@ jobs:
needs: changes
if: ${{ (github.event_name != 'pull_request' && !failure() && !cancelled()) || contains(fromJSON(needs.changes.outputs.samples), 'scala-grpc')}}
with:
java: 17, 21
# Can't test with Java 21+ currently because of https://github.com/lightbend/ssl-config/issues/367
java: 17
scala: 2.13.x, 3.x
gradle-build-root: play-scala-grpc-example
add-dimensions: >-
Expand Down
7 changes: 7 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env bash

# -e Exit script immediately if any command returns a non-zero exit status.
# -u Exit script immediately if an undefined variable is used.
# -o pipefail Ensure Bash pipelines return a non-zero status if any of the commands fail,
# rather than returning the exit status of the last command in the pipeline.
set -euo pipefail

if [ -z "$MATRIX_SCALA" ]; then
echo "Error: the environment variable MATRIX_SCALA is not set"
exit 1
Expand Down

0 comments on commit 992e8d2

Please sign in to comment.