-
Notifications
You must be signed in to change notification settings - Fork 880
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add e2e and unit test comment reports (#2123)
Signed-off-by: zachaller <[email protected]>
- Loading branch information
Showing
6 changed files
with
150 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Test Results | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["E2E Tests", "Go"] | ||
types: | ||
- completed | ||
permissions: {} | ||
|
||
jobs: | ||
test-results: | ||
name: "${{ github.event.workflow.name }} Test Results" | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
actions: read | ||
steps: | ||
- name: Download and Extract Artifacts | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
mkdir -p artifacts && cd artifacts | ||
artifacts_url=${{ github.event.workflow_run.artifacts_url }} | ||
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact | ||
do | ||
IFS=$'\t' read name url <<< "$artifact" | ||
gh api $url > "$name.zip" | ||
unzip -d "$name" "$name.zip" | ||
done | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
with: | ||
check_name: "${{ github.event.workflow.name }} Published Test Results" | ||
commit: ${{ github.event.workflow_run.head_sha }} | ||
event_file: artifacts/Event File/event.json | ||
event_name: ${{ github.event.workflow_run.event }} | ||
files: "artifacts/**/*.xml" | ||
compare_to_earlier_commit: false | ||
test_changes_limit: 0 | ||
fail_on: "errors" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
set -eux -o pipefail | ||
|
||
PROJECT_ROOT=$(cd $(dirname ${BASH_SOURCE})/../..; pwd) | ||
DIST_PATH="${PROJECT_ROOT}/dist" | ||
PATH="${DIST_PATH}:${PATH}" | ||
|
||
mkdir -p ${DIST_PATH} | ||
|
||
gotestsum_version=1.8.1 | ||
|
||
OS=$(go env GOOS) | ||
ARCH=$(go env GOARCH) | ||
|
||
export TARGET_FILE=gotestsum_${gotestsum_version}_${OS}_${ARCH}.tar.gz | ||
temp_path="/tmp/${TARGET_FILE}" | ||
url=https://github.com/gotestyourself/gotestsum/releases/download/v${gotestsum_version}/gotestsum_${gotestsum_version}_${OS}_${ARCH}.tar.gz | ||
[ -e ${temp_path} ] || curl -sLf --retry 3 -o ${temp_path} ${url} | ||
|
||
mkdir -p /tmp/gotestsum-${gotestsum_version} | ||
tar -xvzf ${temp_path} -C /tmp/gotestsum-${gotestsum_version} | ||
cp /tmp/gotestsum-${gotestsum_version}/gotestsum ${DIST_PATH}/gotestsum | ||
chmod +x ${DIST_PATH}/gotestsum | ||
gotestsum --version |