diff options
Diffstat (limited to '.github/actions/common-test-setup/action.yml')
| -rw-r--r-- | .github/actions/common-test-setup/action.yml | 61 |
1 files changed, 46 insertions, 15 deletions
diff --git a/.github/actions/common-test-setup/action.yml b/.github/actions/common-test-setup/action.yml index ab1a665c7..3fc6dd617 100644 --- a/.github/actions/common-test-setup/action.yml +++ b/.github/actions/common-test-setup/action.yml @@ -40,13 +40,8 @@ runs: chmod +x github_artifact/${cmake_config}/bin/* 2>/dev/null || echo "No executables to make executable" # Set up bin_dir based on platform and config - if [[ "${{ inputs.platform }}" == "wasm" ]]; then - bin_dir=build.em/Release/bin - echo "bin_dir=$bin_dir" >> $GITHUB_ENV - else - bin_dir=$(pwd)/github_artifact/${cmake_config}/bin - echo "bin_dir=$bin_dir" >> $GITHUB_ENV - fi + bin_dir=$(pwd)/github_artifact/${cmake_config}/bin + echo "bin_dir=$bin_dir" >> $GITHUB_ENV # Also set lib_dir for slangpy tests lib_dir=$(pwd)/github_artifact/${cmake_config}/lib @@ -61,21 +56,57 @@ runs: # On Windows, DLLs should be in the same directory as executables or in PATH # Use $GITHUB_PATH instead of $PATH for preservation across steps and # avoid unix-like/windows-like path issues - echo "$bin_dir" >> $GITHUB_PATH - echo "$lib_dir" >> $GITHUB_PATH + # echo "$bin_dir" >> $GITHUB_PATH + # echo "$lib_dir" >> $GITHUB_PATH + echo "skipping setting PATH in Windows" fi + # List directory contents + echo "Contents of bin_dir ($bin_dir):" + ls -a "$bin_dir" 2>/dev/null || echo "bin_dir not found" + echo "Contents of lib_dir ($lib_dir):" + ls -a "$lib_dir" 2>/dev/null || echo "lib_dir not found" + - name: Check runtime environment - if: inputs.platform != 'wasm' shell: bash run: | - echo "$bin_dir/slang-test" - "$bin_dir/slang-test" tests/render/check-backend-support-on-ci.slang - smokeResult=$("$bin_dir/slang-test" tests/render/check-backend-support-on-ci.slang) + echo "Checking supported backends" + # Capture the output of slang-test while also displaying it + if ! smokeResult=$("$bin_dir/slang-test" tests/render/check-backend-support-on-ci.slang 2>&1); then + echo "❌ ERROR: slang-test failed to run" + echo "Output: $smokeResult" + exit 1 + fi supportedBackends="$(echo "$smokeResult" | grep 'Supported backends: ')" + echo "$smokeResult" echo "$supportedBackends" - # Windows-specific version checks - fail if tools are not available - if [[ "${{ inputs.os }}" == "windows" ]]; then + + # Check if the output contains "llvm" (case-insensitive) + if echo "$supportedBackends" | grep -qi "llvm"; then + echo "✅ LLVM backend support detected" + else + echo "❌ ERROR: LLVM backend support not detected - this is required to run the filecheck!" + fi + + # Function to check API support + check_api_support() { + local api_list=("$@") + for api in "${api_list[@]}"; do + if echo "$smokeResult" | grep -qi "${api}: Supported"; then + echo "✅ ${api} API support detected" + else + echo "❌ ${api} API support not detected" + exit 1 + fi + done + } + + # Platform-specific API checks - fail if APIs are not available + if [[ "${{ inputs.os }}" == "macos" ]]; then + check_api_support "mtl,metal" + elif [[ "${{ inputs.os }}" == "windows" ]]; then + check_api_support "vk,vulkan" "dx12,d3d12" "dx11,d3d11" "cuda" + echo "Printing CUDA compiler version: ..." nvcc --version || (echo "ERROR: CUDA compiler (nvcc) not available on Windows" && exit 1) echo "Printing GPU driver version: ..." |
