Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion go/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ inputs:
description: A timeout value in seconds. If tests take longer than this, they will fail. Not setting this value will fallback to go test's default of 10 minutes.
required: false
default: ""
PARALLEL:
description: Whether to run tests in parallel. Defaults to true.
required: false
default: "true"

runs:
using: 'composite'
steps:
- name: Running go tests
shell: bash
run: ${GITHUB_ACTION_PATH}/test.sh "${{ inputs.TAGS }}" "${{ inputs.TIMEOUT }}"
run: ${GITHUB_ACTION_PATH}/test.sh "${{ inputs.TAGS }}" "${{ inputs.TIMEOUT }}" "${{ inputs.PARALLEL }}"
- name: Uploading test report
uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions go/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -e

TAGS=$1
TIMEOUT=$2
PARALLEL=$3

cmd="go test 2>&1 ./... -coverprofile=coverage.out"

Expand Down Expand Up @@ -31,6 +32,10 @@ if [ -n "$TIMEOUT" ]; then
cmd="$cmd -timeout ${TIMEOUT}s"
fi

if [ "$PARALLEL" = "false" ]; then
cmd="$cmd -p 1"
fi

echo "$cmd | tee test-report.out"
eval "$cmd" | tee test-report.out

Expand Down
Loading