GitHub Actions for test

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2020-12-05 04:18:23 +01:00
parent 99ac03f9f3
commit b1215c2ce2
8 changed files with 211 additions and 39 deletions

View File

@ -4,6 +4,9 @@
: ${PREFER_BUILDCTL=}
: ${PREFER_LEGACY=}
: ${CLI_PLATFORM=}
: ${GITHUB_ACTIONS=}
: ${CACHEDIR_FROM=}
: ${CACHEDIR_TO=}
newerEqualThan() { # $1=minimum wanted version $2=actual-version
[ "$1" = "$(printf "$1\n$2" | sort -V | head -n 1)" ]
@ -54,3 +57,19 @@ if [ -z "$CLI_PLATFORM" ]; then
CLI_PLATFORM="windows/amd64"
fi
fi
cacheType=""
cacheRefFrom=""
cacheRefTo=""
currentref=""
if [ "$GITHUB_ACTIONS" = "true" ]; then
currentref="git://github.com/$GITHUB_REPOSITORY#$GITHUB_REF"
cacheType="local"
cacheRefFrom="$CACHEDIR_FROM"
cacheRefTo="$CACHEDIR_TO"
fi
currentcontext="."
if [ -n "$currentref" ]; then
currentcontext="--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 $currentref"
fi