-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (115 loc) · 4.3 KB
/
Copy pathsmoke.yml
File metadata and controls
134 lines (115 loc) · 4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: smoke
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:
env:
BUILD_TYPE: Release
CMAKE_GENERATOR: Ninja
WEBVULKAN_CACHE_VERSION: v1
LLVM_PREBUILT_URL: ${{ vars.WEBVULKAN_LLVM_PREBUILT_URL }}
LLVM_PREBUILT_SHA256: ${{ vars.WEBVULKAN_LLVM_PREBUILT_SHA256 }}
jobs:
in_tree_add_subdirectory:
name: in-tree add_subdirectory smoke
runs-on: ubuntu-latest
timeout-minutes: 240
steps:
- uses: actions/checkout@v4
- name: Install host tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build flex bison python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install cmake==4.2.0
- name: Restore third-party cache
uses: actions/cache@v4
with:
path: |
.3rdparty
key: ${{ runner.os }}-webvulkan-thirdparty-${{ env.WEBVULKAN_CACHE_VERSION }}
- name: Select LLVM provider
id: llvm_provider
shell: bash
run: |
if [ -n "${LLVM_PREBUILT_URL}" ]; then
echo "mode=prebuilt" >> "$GITHUB_OUTPUT"
ARGS="-DLLVM_PROVIDER=prebuilt -DLLVM_PREBUILT_URL=${LLVM_PREBUILT_URL}"
if [ -n "${LLVM_PREBUILT_SHA256}" ]; then
ARGS="${ARGS} -DLLVM_PREBUILT_SHA256=${LLVM_PREBUILT_SHA256}"
fi
echo "args=${ARGS}" >> "$GITHUB_OUTPUT"
else
echo "mode=source" >> "$GITHUB_OUTPUT"
echo "args=-DLLVM_PROVIDER=source -DLLVM_GIT_REF=main" >> "$GITHUB_OUTPUT"
fi
- name: Configure root project
run: |
cmake -S . -B build -G "${CMAKE_GENERATOR}" \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DWEBVULKAN_BUILD_TESTS=ON \
${{ steps.llvm_provider.outputs.args }}
- name: Build and run in-tree smoke
run: |
cmake --build build --target runtime_smoke --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
package_sparse_tests:
name: package sparse-tests smoke
runs-on: ubuntu-latest
timeout-minutes: 180
needs:
- in_tree_add_subdirectory
steps:
- uses: actions/checkout@v4
with:
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
uses: actions/cache@v4
with:
path: |
.3rdparty
key: ${{ runner.os }}-webvulkan-thirdparty-${{ env.WEBVULKAN_CACHE_VERSION }}
- name: Bootstrap emsdk when cache is empty
run: |
if [ ! -x "${GITHUB_WORKSPACE}/.3rdparty/emsdk/upstream/emscripten/emcc" ]; then
rm -rf "${GITHUB_WORKSPACE}/.3rdparty/emsdk"
git clone --depth 1 https://github.com/emscripten-core/emsdk.git "${GITHUB_WORKSPACE}/.3rdparty/emsdk"
"${GITHUB_WORKSPACE}/.3rdparty/emsdk/emsdk" install latest
"${GITHUB_WORKSPACE}/.3rdparty/emsdk/emsdk" activate latest
fi
- name: Download relocatable package
uses: actions/download-artifact@v4
with:
name: webvulkan-package
path: package
- 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" \
-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}"