[github] Test that webgpu_cpp.h compiles under CMake
Add HelloTriangle (which uses webgpu_cpp.h) to package-emdawnwebgpu.sh
so it prevents us from publishing builds where it doesn't compile. CQ
should theoretically prevent this but it's good to have an extra check;
see https://dawn-review.googlesource.com/265974.
No-Try: true
Bug: 450675299
Change-Id: Icae68a4afd461bea90f8c10ff21f873120b9a894
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/266015
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
diff --git a/.github/workflows/package-emdawnwebgpu.sh b/.github/workflows/package-emdawnwebgpu.sh
index 659b928..77b8cdd 100755
--- a/.github/workflows/package-emdawnwebgpu.sh
+++ b/.github/workflows/package-emdawnwebgpu.sh
@@ -52,14 +52,15 @@
-DCMAKE_BUILD_TYPE=Debug
make -j4 -C out/wasm emdawnwebgpu_link_test
-# Switch the build type (in-place to save time), rebuild the link test (this
-# time with Closure, which verifies the linked JS to some extent), and build the
-# final package (which is not actually affected by build type).
+# Switch the build type (in-place to save time), rebuild the link test and a C++
+# sample (to verify webgpu_cpp.h builds and to run Closure, which verifies the
+# linked JS to some extent), and build the final package (which is not actually
+# affected by build type).
# TODO: If we have Ninja (from depot_tools), we could use -G'Ninja Multi-Config'
# to do multiple build types more cleanly.
# https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html
cmake -S=. -B=out/wasm -DCMAKE_BUILD_TYPE=Release
-make -j4 -C out/wasm emdawnwebgpu_pkg emdawnwebgpu_link_test
+make -j4 -C out/wasm emdawnwebgpu_pkg emdawnwebgpu_link_test HelloTriangle
# Get variables for documentation.
SHA=$(git rev-parse HEAD)