Skip to content

Commit

Permalink
hack: mount docker config on gha
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 21, 2024
1 parent 4b5d78d commit d83af51
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hack/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -eu -o pipefail

: "${GITHUB_ACTIONS=}"

: "${BUILDX_CMD=docker buildx}"

: "${TEST_COVERAGE=}"
Expand Down Expand Up @@ -37,7 +39,15 @@ if [ "$TEST_COVERAGE" = "1" ]; then
export GO_TEST_COVERPROFILE="/testreports/coverage-report$TEST_REPORT_SUFFIX.txt"
fi

cid=$(docker create --rm --privileged \
dockerConfigMount=""
if [ "$GITHUB_ACTIONS" = "true" ]; then
dockerConfigPath="$HOME/.docker/config.json"
if [ -f "$dockerConfigPath" ]; then
dockerConfigMount="-v $dockerConfigPath:/root/.docker/config.json:ro"
fi
fi

cid=$(docker create --rm --privileged $dockerConfigMount \
-v /tmp $testReportsVol \
--volumes-from=$cacheVolume \
-e GITHUB_REF \
Expand Down

0 comments on commit d83af51

Please sign in to comment.