From 0d138b3ca222712f7c52afad2ff21865b863ea77 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 14 Feb 2023 17:35:12 -0800 Subject: [PATCH 1/4] Use gotestsum --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c74df4eb42..04dc41fb79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,8 +39,11 @@ jobs: - name: install ./... run: go install ./... + - name: gotestsum + run: go install gotest.tools/gotestsum@latest + - name: test ./... - run: go test --tags=examples ./... + run: gotestsum --junitfile junit.xml --tags=examples ./... env: PG_USER: postgres PG_HOST: localhost From 715608b40e496d94d3901f45aae43e12a771e6ca Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 14 Feb 2023 17:43:25 -0800 Subject: [PATCH 2/4] Report test runs --- .github/workflows/ci.yml | 11 ++++++++--- scripts/report.sh | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100755 scripts/report.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04dc41fb79..c26fd04bed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,12 +36,12 @@ jobs: with: go-version: '1.19' - - name: install ./... - run: go install ./... - - name: gotestsum run: go install gotest.tools/gotestsum@latest + - name: install ./... + run: go install ./... + - name: test ./... run: gotestsum --junitfile junit.xml --tags=examples ./... env: @@ -58,3 +58,8 @@ jobs: - name: build internal/endtoend run: go build ./... working-directory: internal/endtoend/testdata + + - name: report + run: ./scripts/report.sh + env: + BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_ANALYTICS_TOKEN }} diff --git a/scripts/report.sh b/scripts/report.sh new file mode 100755 index 0000000000..31302f4d21 --- /dev/null +++ b/scripts/report.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +curl \ + -X POST \ + --fail-with-body \ + -H "Authorization: Token token=\"$BUILDKITE_ANALYTICS_TOKEN\"" \ + -F "data=@junit.xml" \ + -F "format=junit" \ + -F "run_env[CI]=buildkite" \ + -F "run_env[key]=$GITHUB_RUN_ID" \ + -F "run_env[number]=$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" \ + -F "run_env[job_id]=$GITHUB_RUN_ID" \ + -F "run_env[branch]=$GITHUB_REF" \ + -F "run_env[commit_sha]=$GITHUB_SHA" \ + -F "run_env[message]=Foo" \ + -F "run_env[url]=$GITHUB_SERVER_URL" \ + https://analytics-api.buildkite.com/v1/uploads From 6b1b4a33f1780eb275dffed52925cda9d04c2182 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 14 Feb 2023 17:50:24 -0800 Subject: [PATCH 3/4] Fix tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c26fd04bed..05dfa5122b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: run: go install ./... - name: test ./... - run: gotestsum --junitfile junit.xml --tags=examples ./... + run: gotestsum --junitfile junit.xml -- --tags=examples ./... env: PG_USER: postgres PG_HOST: localhost From f726d890f79c096efd93bd1e7e1e9ec4889f8a21 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 14 Feb 2023 17:53:57 -0800 Subject: [PATCH 4/4] Kick GitHub Actions