From 84697e0e49eb51469309957c395b6c126d4ac50b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Dudfield?= Date: Tue, 2 Jul 2024 11:12:38 +0200 Subject: [PATCH] github: backend-test: Add tracing to steps for easy debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we can see which of the bash commands in a run block are failing. Signed-off-by: René Dudfield --- .github/workflows/backend-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/backend-test.yml b/.github/workflows/backend-test.yml index 006bbad8fe7..6d2400d3b8d 100644 --- a/.github/workflows/backend-test.yml +++ b/.github/workflows/backend-test.yml @@ -46,6 +46,7 @@ jobs: - name: Run tests and calculate code coverage run: | + set -o x cd backend go test ./... -coverprofile=coverage.out -covermode=atomic -coverpkg=./... testcoverage=$(go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+') @@ -58,6 +59,7 @@ jobs: - name: Get base branch code coverage if: ${{ github.event_name }} == 'pull_request' run: | + set -o x cd backend base_branch="${{ github.base_ref }}" testcoverage="${{ env.coverage }}" @@ -72,6 +74,7 @@ jobs: - name: Compare code coverage if: ${{ github.event_name }} == 'pull_request' run: | + set -o x testcoverage="${{ env.coverage }}" base_coverage="${{ env.base_coverage }}" if [[ -z $testcoverage || -z $base_coverage ]]; then @@ -91,6 +94,7 @@ jobs: - name: Comment on PR if: ${{ github.event_name }} == 'pull_request' run: | + set -o x testcoverage="${{ env.coverage }}" base_coverage="${{ env.base_coverage }}" coverage_diff="${{ env.coverage_diff }}"