Merge pull request #15519 from fuweid/remove-tee-in-ci

chore: introduce strict bash mode for scripts,.github
This commit is contained in:
Benjamin Wang
2023-03-23 06:28:02 +08:00
committed by GitHub
29 changed files with 137 additions and 69 deletions

View File

@@ -26,6 +26,8 @@ jobs:
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64)

View File

@@ -9,4 +9,7 @@ jobs:
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version: "1.19.7"
- run: make -C contrib/mixin tools test
- run: |
set -euo pipefail
make -C contrib/mixin tools test

View File

@@ -23,11 +23,12 @@ jobs:
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-arm64-e2e)
PASSES='build release e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! grep -E "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
PASSES='build release e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh
;;
*)
echo "Failed to find target"

View File

@@ -19,15 +19,15 @@ jobs:
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-e2e)
PASSES='build release e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! grep -E "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
PASSES='build release e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh
;;
linux-386-e2e)
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! grep -E "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
GOARCH=386 PASSES='build e2e' CPU='4' EXPECT_DEBUG='true' COVER='false' RACE='true' ./scripts/test.sh
;;
*)
echo "Failed to find target"

View File

@@ -13,7 +13,10 @@ jobs:
- uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version: "1.19.7"
- run: GOARCH=amd64 CPU=4 make fuzz
- run: |
set -euo pipefail
GOARCH=amd64 CPU=4 make fuzz
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: failure()
with:

View File

@@ -10,4 +10,7 @@ jobs:
with:
go-version: "1.19.7"
- run: date
- run: go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./...
- run: |
set -euo pipefail
go install golang.org/x/vuln/cmd/govulncheck@latest && govulncheck ./...

View File

@@ -19,15 +19,15 @@ jobs:
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
echo "${TARGET}"
case "${TARGET}" in
linux-amd64-grpcproxy-integration)
PASSES='build grpcproxy_integration' CPU='4' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! grep -E "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
PASSES='build grpcproxy_integration' CPU='4' COVER='false' RACE='true' ./scripts/test.sh
;;
linux-amd64-grpcproxy-e2e)
PASSES='build grpcproxy_e2e' CPU='4' COVER='false' RACE='true' ./scripts/test.sh 2>&1 | tee test.log
! grep -E "(--- FAIL:|FAIL:|DATA RACE|panic: test timed out|appears to have leaked)" -B50 -A10 test.log
PASSES='build grpcproxy_e2e' CPU='4' COVER='false' RACE='true' ./scripts/test.sh
;;
*)
echo "Failed to find target"

View File

@@ -10,6 +10,8 @@ jobs:
with:
go-version: "1.19.7"
- run: |
set -euo pipefail
git config --global user.email "github-action@etcd.io"
git config --global user.name "Github Action"
gpg --batch --gen-key <<EOF

View File

@@ -29,6 +29,8 @@ jobs:
env:
GITHUB_REF: ${{ inputs.ref }}
run: |
set -euo pipefail
case "${GITHUB_REF}" in
release-3.5)
make build-failpoints-release-3.5
@@ -45,6 +47,8 @@ jobs:
esac
- name: test-robustness
run: |
set -euo pipefail
# Use --failfast to avoid overriding report generated by failed test
EXPECT_DEBUG=true GO_TEST_FLAGS='-v --count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} --failfast --run TestRobustness' RESULTS_DIR=/tmp/results make test-robustness
- uses: actions/upload-artifact@v2

View File

@@ -18,5 +18,11 @@ jobs:
with:
version: '3.14.0'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: make verify
- run: make fix
- run: |
set -euo pipefail
make verify
- run: |
set -euo pipefail
make fix

View File

@@ -25,6 +25,8 @@ jobs:
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in

View File

@@ -22,6 +22,8 @@ jobs:
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in