update workflow to use windows 2022 image (#4580)

* update workflow to use windows 2022 image

* return the version of the run vcpkg action

the action has been changed to now use a vcpkg.json file instead of the
txt file we use now, we should try to find a way to update it to the new
workflow in case the current one becomes obsolete

* clean up a bit for consistency

* run ctest directly instead of relying on the makefile

* set -C flag for ctest

* set config option for cmake --build

this option is ignored for other platforms
This commit is contained in:
ebbit1q 2022-02-27 22:32:54 +01:00 committed by GitHub
parent 2a54e9d7d1
commit 92ed53e13a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 45 deletions

View file

@ -18,7 +18,7 @@ image_cache="image"
ccache_cache=".ccache"
# Read arguments
while [[ "$@" ]]; do
while [[ $# != 0 ]]; do
case "$1" in
'--build')
BUILD=1
@ -70,7 +70,7 @@ if ! [[ $CACHE ]]; then
else
if ! [[ -d $CACHE ]]; then
echo "could not find cache dir: $CACHE" >&2
mkdir -p $CACHE
mkdir -p "$CACHE"
unset GET # the dir is empty
fi
if [[ $GET || $SAVE ]]; then
@ -133,11 +133,11 @@ function RUN ()
{
echo "running image:"
if docker images | grep "$IMAGE_NAME"; then
args="--mount type=bind,source=$PWD,target=/src -w=/src"
args=(--mount "type=bind,source=$PWD,target=/src" -w="/src")
if [[ $CCACHE_DIR ]]; then
args+=" --mount type=bind,source=$CCACHE_DIR,target=/.ccache -e CCACHE_DIR=/.ccache"
args+=(--mount "type=bind,source=$CCACHE_DIR,target=/.ccache" -e "CCACHE_DIR=/.ccache")
fi
docker run $args $RUN_ARGS "$IMAGE_NAME" bash "$BUILD_SCRIPT" $RUN_OPTS $@
docker run "${args[@]}" $RUN_ARGS "$IMAGE_NAME" bash "$BUILD_SCRIPT" $RUN_OPTS "$@"
return $?
else
echo "could not find docker image: $IMAGE_NAME" >&2