Actions: set -euo pipefail on multi-cmd runs (#106906)

This commit is contained in:
Mariell Hoversholm
2025-06-18 15:50:30 +02:00
committed by GitHub
parent afee9e47f2
commit 24192745b6
3 changed files with 7 additions and 0 deletions
+2
View File
@@ -53,6 +53,7 @@ jobs:
env:
SHARD: ${{ matrix.shard }}
run: |
set -euo pipefail
readarray -t PACKAGES <<< "$(./scripts/ci/backend-tests/shard.sh -N"$SHARD")"
go test -short -timeout=30m "${PACKAGES[@]}"
@@ -117,6 +118,7 @@ jobs:
bucket: grafana-test-results
- if: github.repository == 'grafana/grafana' && (success() || failure())
run: |
set -euo pipefail
BUCKET_PATH="go-unit-tests/$(echo "${REF_NAME}" | sed 's/\//-/g')"
echo "BUCKET_PATH=$BUCKET_PATH" >> "$GITHUB_ENV"
env:
+2
View File
@@ -59,6 +59,7 @@ jobs:
- name: Build E2E test runner
id: artifact
run: |
set -euo pipefail
# We want a static binary, so we need to set CGO_ENABLED=0
CGO_ENABLED=0 go build -o ./e2e-runner ./e2e/
echo "artifact=e2e-runner-${{github.run_number}}" >> "$GITHUB_OUTPUT"
@@ -127,6 +128,7 @@ jobs:
env:
SUITE: ${{ matrix.path }}
run: |
set -euo pipefail
echo "suite=$(echo "$SUITE" | sed 's/\//-/g')" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
if: success() || failure()
@@ -47,6 +47,7 @@ jobs:
env:
SHARD: ${{ matrix.shard }}
run: |
set -euo pipefail
readarray -t PACKAGES <<< "$(./scripts/ci/backend-tests/pkgs-with-tests-named.sh -b TestIntegration | ./scripts/ci/backend-tests/shard.sh -N"$SHARD" -d-)"
go test -tags=sqlite -timeout=5m -run '^TestIntegration' "${PACKAGES[@]}"
mysql:
@@ -94,6 +95,7 @@ jobs:
env:
SHARD: ${{ matrix.shard }}
run: |
set -euo pipefail
readarray -t PACKAGES <<< "$(./scripts/ci/backend-tests/pkgs-with-tests-named.sh -b TestIntegration | ./scripts/ci/backend-tests/shard.sh -N"$SHARD" -d-)"
go test -p=1 -tags=mysql -timeout=5m -run '^TestIntegration' "${PACKAGES[@]}"
postgres:
@@ -140,5 +142,6 @@ jobs:
env:
SHARD: ${{ matrix.shard }}
run: |
set -euo pipefail
readarray -t PACKAGES <<< "$(./scripts/ci/backend-tests/pkgs-with-tests-named.sh -b TestIntegration | ./scripts/ci/backend-tests/shard.sh -N"$SHARD" -d-)"
go test -p=1 -tags=postgres -timeout=5m -run '^TestIntegration' "${PACKAGES[@]}"