Skip to content

Stabilize smoke CI prebuilt setup and host deps #20

Stabilize smoke CI prebuilt setup and host deps

Stabilize smoke CI prebuilt setup and host deps #20

Workflow file for this run

name: smoke
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:
inputs:
run_extended_smoke:
description: Run extended hot-loop runtime smoke profile
required: false
default: false
type: boolean
concurrency:
group: smoke-${{ github.ref }}
cancel-in-progress: true
env:
BUILD_TYPE: Release
CMAKE_GENERATOR: Ninja
WEBVULKAN_CACHE_VERSION: v3
LLVM_PREBUILT_URL: https://github.com/Devsh-Graphics-Programming/llvmpipe2wasm/releases/download/llvm-wasm-prebuilt-latest/llvm-wasm-install.zip
LLVM_PREBUILT_SHA256: ""
DXC_WASM_PREBUILT_URL: https://github.com/Devsh-Graphics-Programming/llvmpipe2wasm/releases/download/dxc-wasm-prebuilt-latest/dxc-wasm-prebuilt.zip
jobs:
in_tree_add_subdirectory:
name: in-tree add_subdirectory
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install host tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build flex bison python3-pip glslang-tools
python3 -m pip install --upgrade pip
python3 -m pip install meson mako
python3 -m pip install cmake==4.2.0
- name: Restore third-party cache
id: cache_thirdparty
uses: actions/cache/restore@v4
with:
path: |
.3rdparty
key: ${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-${{ env.LLVM_PREBUILT_SHA256 }}
restore-keys: |
${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-
- name: Restore Mesa wasm build cache
id: cache_webvulkan_build
uses: actions/cache/restore@v4
with:
path: |
build/_webvulkan
build/.webvulkan_llvmpipe.stamp
key: ${{ runner.os }}-webvulkan-build-${{ env.WEBVULKAN_CACHE_VERSION }}-${{ hashFiles('CMakeLists.txt', 'cmake/BuildMesaLlvmpipeWasm.cmake', 'tests/CMakeLists.txt', 'tests/RunLavapipeRuntimeSmoke.cmake') }}-${{ env.LLVM_PREBUILT_SHA256 }}
restore-keys: |
${{ runner.os }}-webvulkan-build-${{ env.WEBVULKAN_CACHE_VERSION }}-
- name: Bootstrap DXC Wasm prebuilt
shell: bash
run: |
set -euo pipefail
dxc_dir="${GITHUB_WORKSPACE}/.3rdparty/dxc-wasm"
dxc_js="${dxc_dir}/dxc.js"
dxc_wasm="${dxc_dir}/dxc.wasm"
if [ ! -f "${dxc_js}" ] || [ ! -f "${dxc_wasm}" ]; then
mkdir -p "${dxc_dir}"
curl -L --fail "${DXC_WASM_PREBUILT_URL}" -o "${RUNNER_TEMP}/dxc-wasm-prebuilt.zip"
python3 -c "import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])" \
"${RUNNER_TEMP}/dxc-wasm-prebuilt.zip" "${dxc_dir}"
fi
test -f "${dxc_js}"
test -f "${dxc_wasm}"
echo "WEBVULKAN_DXC_WASM_JS=${dxc_js}" >> "${GITHUB_ENV}"
- name: Configure root project
run: |
cmake -S . -B build -G "${CMAKE_GENERATOR}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DWEBVULKAN_BUILD_TESTS=ON \
-DWEBVULKAN_DXC_WASM_JS="${WEBVULKAN_DXC_WASM_JS}" \
-DWEBVULKAN_ALLOW_DEP_UPDATES=OFF \
-DLLVM_PROVIDER=prebuilt \
-DLLVM_PREBUILT_URL="${LLVM_PREBUILT_URL}" \
-DLLVM_PREBUILT_SHA256="${LLVM_PREBUILT_SHA256}"
- name: Build and run in-tree smoke
run: |
cmake --build build --target runtime_smoke --config "${BUILD_TYPE}"
- name: Build and run extended in-tree smoke
if: ${{ github.event_name == 'workflow_dispatch' && inputs.run_extended_smoke }}
run: |
cmake --build build --target lavapipe_runtime_smoke_hot_loop --config "${BUILD_TYPE}"
- name: Install relocatable package
run: |
cmake --install build --prefix "${GITHUB_WORKSPACE}/package"
- name: Upload relocatable package
uses: actions/upload-artifact@v4
with:
name: webvulkan-package
path: package
if-no-files-found: error
- name: Save Mesa wasm build cache
if: always() && steps.cache_webvulkan_build.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
build/_webvulkan
build/.webvulkan_llvmpipe.stamp
key: ${{ steps.cache_webvulkan_build.outputs.cache-primary-key }}
- name: Save third-party cache
if: always() && steps.cache_thirdparty.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
.3rdparty
key: ${{ steps.cache_thirdparty.outputs.cache-primary-key }}
package_sparse_tests:
name: package sparse-tests
runs-on: ubuntu-latest
timeout-minutes: 180
needs:
- in_tree_add_subdirectory
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: tests-only
sparse-checkout: |
tests
sparse-checkout-cone-mode: false
- name: Install host tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install cmake==4.2.0
- name: Restore third-party cache
id: cache_thirdparty
uses: actions/cache/restore@v4
with:
path: |
.3rdparty
key: ${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-${{ env.LLVM_PREBUILT_SHA256 }}
restore-keys: |
${{ runner.os }}-webvulkan-3rdparty-${{ env.WEBVULKAN_CACHE_VERSION }}-
- name: Download relocatable package
uses: actions/download-artifact@v4
with:
name: webvulkan-package
path: package
- name: Validate cached emsdk
shell: bash
run: |
if [ ! -x "${GITHUB_WORKSPACE}/.3rdparty/emsdk/upstream/emscripten/emcc" ]; then
echo "emsdk is missing in cache. Re-run workflow after in-tree job saves cache."
exit 1
fi
- name: Bootstrap DXC Wasm prebuilt
shell: bash
run: |
set -euo pipefail
dxc_dir="${GITHUB_WORKSPACE}/.3rdparty/dxc-wasm"
dxc_js="${dxc_dir}/dxc.js"
dxc_wasm="${dxc_dir}/dxc.wasm"
if [ ! -f "${dxc_js}" ] || [ ! -f "${dxc_wasm}" ]; then
mkdir -p "${dxc_dir}"
curl -L --fail "${DXC_WASM_PREBUILT_URL}" -o "${RUNNER_TEMP}/dxc-wasm-prebuilt.zip"
python3 -c "import sys,zipfile; zipfile.ZipFile(sys.argv[1]).extractall(sys.argv[2])" \
"${RUNNER_TEMP}/dxc-wasm-prebuilt.zip" "${dxc_dir}"
fi
test -f "${dxc_js}"
test -f "${dxc_wasm}"
echo "WEBVULKAN_DXC_WASM_JS=${dxc_js}" >> "${GITHUB_ENV}"
- name: Configure sparse tests against package
run: |
cmake -S tests-only/tests -B tests-only/build -G "${CMAKE_GENERATOR}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DWEBVULKAN_TEST_MODE=package \
-DWEBVULKAN_TEST_PACKAGE_PREFIX="${GITHUB_WORKSPACE}/package" \
-DWEBVULKAN_DXC_WASM_JS="${WEBVULKAN_DXC_WASM_JS}" \
-DEMSDK_ROOT="${GITHUB_WORKSPACE}/.3rdparty/emsdk" \
-DWEBVULKAN_EMSCRIPTEN_TOOLCHAIN_FILE="${GITHUB_WORKSPACE}/.3rdparty/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
- name: Build and run package smoke
run: |
cmake --build tests-only/build --target runtime_smoke --config "${BUILD_TYPE}"