diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c74df4eb42..05dfa5122b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,11 +36,14 @@ jobs: with: go-version: '1.19' + - name: gotestsum + run: go install gotest.tools/gotestsum@latest + - name: install ./... run: go install ./... - name: test ./... - run: go test --tags=examples ./... + run: gotestsum --junitfile junit.xml -- --tags=examples ./... env: PG_USER: postgres PG_HOST: localhost @@ -55,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