Skip to content

Commit

Permalink
test-cmake: Refinements for GH runners
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-obx committed Aug 5, 2024
1 parent 172494c commit 8d83fd9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
#- run: make
#- run: make test-depend
#- run: make test
- run: make test-cmake
- run: make test-cmake GH_RUNNER_OS=${{ runner.os }}

#- name: Upload artifact
# uses: actions/upload-artifact@v4
Expand Down
40 changes: 26 additions & 14 deletions test/standalone-cmake/test.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,41 @@
#!/usr/bin/env bash
set -xeuo pipefail

topdir=$(realpath `dirname "$0"`)
topdir=$(dirname "$(readlink -f "$0")")
projects=("cpp-flat")

uname=`uname`
case $uname in
Linux)
single_generators=("Unix Makefiles" "Ninja")
multi_generators=("Ninja Multi-Config")
;;
Darwin)
single_generators=("Unix Makefiles" "Ninja")
multi_generators=("Xcode" "Ninja Multi-Config")

single_generators=()
multi_generators=()

# Auto-detect tools on path:

if [ `command -v ninja` ]; then
single_generators+=("Ninja")
multi_generators+=("Ninja Multi-Config")
fi

if [ `command -v make` ]; then
single_generators+=("Unix Makefiles")
fi

# Add predefined generators based on GH runner os:
case ${GH_RUNNER_OS:-} in
macOS)
multi_generators+=("Xcode")
;;
Windows*|CYG*|MINGW*)
single_generators=("Nmake Makefiles")
multi_generators=("Visual Studio 16 2019")
Windows)
multi_generators+=("Visual Studio 16 2019")
;;
*)
echo "unsupported platform `uname`"
exit 1
;;
esac

echo "**** Testing Generators (after auto-detect):"
echo "Single Generators: ${single_generators[@]}"
echo "Multi-Config Generators: ${multi_generators[@]}"

clean()
{
srcdir=$1
Expand Down

0 comments on commit 8d83fd9

Please sign in to comment.