@@ -38,17 +38,13 @@ jobs:
38
38
if : matrix.os == 'ubuntu-20.04'
39
39
run : |
40
40
sudo apt-get update
41
- sudo apt-get install libvulkan-dev glslang-tools libsdl2-dev
41
+ sudo apt-get install libsdl2-dev
42
42
43
43
- name : Install system dependencies macOS
44
44
if : matrix.os == 'macOS-latest'
45
45
shell : bash
46
46
run : |
47
47
brew install pkg-config sdl2
48
- brew tap apenngrace/homebrew-vulkan
49
- brew install --cask vulkan-sdk --verbose ||
50
- brew install --cask vulkan-sdk --verbose ||
51
- brew install --cask vulkan-sdk --verbose
52
48
53
49
- name : Install system dependencies Windows
54
50
if : matrix.os == 'windows-latest'
@@ -61,27 +57,31 @@ jobs:
61
57
printf "%s\n" "$SDL2/bin" >> "$GITHUB_PATH"
62
58
printf "%s\n" "PKG_CONFIG_PATH=$SDL2/lib/pkgconfig" >> "$GITHUB_ENV"
63
59
64
- choco install vulkan-sdk
65
- VulkanSDK=$(cygpath --windows --absolute /c/VulkanSDK/*/)
66
- printf "%s\n" "$VulkanSDK/Bin" >> "$GITHUB_PATH"
67
- curl -L https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-runtime-components.zip?u= > vulkan-runtime-components.zip
68
- unzip vulkan-runtime-components.zip
69
- printf "%s\n" "$(cygpath --windows --absolute VulkanRT-*/x64)" >> "$GITHUB_PATH"
70
-
71
60
cat >> cabal.project <<EOF
72
61
package sdl2
73
62
extra-lib-dirs: $SDL2/lib/
74
63
extra-include-dirs: $SDL2/include/SDL2/
64
+ EOF
75
65
76
- package vulkan
77
- extra-lib-dirs: $VulkanSDK/Lib/
78
-
79
- package vulkan-utils
80
- extra-include-dirs: $VulkanSDK/Include/
66
+ - name : Prepare Vulkan SDK
67
+
68
+ with :
69
+ vulkan-query-version : latest
70
+ vulkan-components : Vulkan-Headers, Vulkan-Loader, Glslang
71
+ vulkan-use-cache : true
81
72
82
- package VulkanMemoryAllocator
83
- extra-include-dirs: $VulkanSDK/Include/
73
+ - name : Inform Cabal about Vulkan
74
+ shell : bash
75
+ run : |
76
+ cat >> cabal.project <<EOF
77
+ extra-lib-dirs: $VULKAN_SDK/lib/
78
+ extra-include-dirs: $VULKAN_SDK/include/
84
79
EOF
80
+ printf "%s\n" "$VULKAN_SDK/bin" >> "$GITHUB_PATH"
81
+ if uname -s | grep -i mingw; then sep=';'; else sep=':'; fi
82
+ printf "%s\n" "PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}${sep}}$VULKAN_SDK/lib/pkgconfig" >> "$GITHUB_ENV"
83
+ # until this is fixed https://github.com/haskell/cabal/issues/7339
84
+ printf "%s\n" "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}${sep}}$VULKAN_SDK/lib" >> "$GITHUB_ENV"
85
85
86
86
- name : Remove openxr
87
87
run : |
@@ -157,11 +157,14 @@ jobs:
157
157
${{ runner.os }}-stack-global-${{ matrix.stack-args }}
158
158
${{ runner.os }}-stack-global
159
159
160
+ - name : Set up yq
161
+ uses : frenck/action-setup-yq@v1
162
+
160
163
- name : Install system dependencies Linux
161
164
if : matrix.os == 'ubuntu-20.04'
162
165
run : |
163
166
sudo apt-get update
164
- sudo apt-get install libvulkan-dev glslang-tools libsdl2-dev
167
+ sudo apt-get install libsdl2-dev
165
168
166
169
- name : Install system dependencies Windows
167
170
if : matrix.os == 'windows-latest'
@@ -174,47 +177,51 @@ jobs:
174
177
printf "%s\n" "$SDL2/bin" >> "$GITHUB_PATH"
175
178
printf "%s\n" "PKG_CONFIG_PATH=$SDL2/lib/pkgconfig" >> "$GITHUB_ENV"
176
179
177
- choco install vulkan-sdk
178
- VulkanSDK=$(cygpath --windows --absolute /c/VulkanSDK/*/)
179
- printf "%s\n" "$VulkanSDK/Bin" >> "$GITHUB_PATH"
180
- curl -L https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-runtime-components.zip?u= > vulkan-runtime-components.zip
181
- unzip vulkan-runtime-components.zip
182
- printf "%s\n" "$(cygpath --windows --absolute VulkanRT-*/x64)" >> "$GITHUB_PATH"
183
-
184
- cat >> stack.yaml <<EOF
185
- extra-lib-dirs:
186
- - $SDL2/lib/
187
- - $VulkanSDK/Lib/
188
- extra-include-dirs:
189
- - $SDL2/include/SDL2/
190
- - $VulkanSDK/Include/
191
- EOF
180
+ yq --inplace ".\"extra-lib-dirs\" += [\"$SDL2/lib/\"]" stack.yaml
181
+ yq --inplace ".\"extra-include-dirs\" += [\"$SDL2/include/\"]" stack.yaml
192
182
193
183
- name : Install system dependencies macOS
194
184
if : matrix.os == 'macOS-latest'
195
185
shell : bash
196
186
run : |
197
187
brew install pkg-config sdl2
198
- brew tap apenngrace/homebrew-vulkan --verbose
199
- brew install --cask vulkan-sdk --verbose ||
200
- brew install --cask vulkan-sdk --verbose ||
201
- brew install --cask vulkan-sdk --verbose
188
+
189
+ - name : Prepare Vulkan SDK
190
+
191
+ with :
192
+ vulkan-query-version : latest
193
+ vulkan-components : Vulkan-Headers, Vulkan-Loader, Glslang
194
+ vulkan-use-cache : true
195
+
196
+ - name : Inform Stack about Vulkan
197
+ shell : bash
198
+ run : |
199
+ yq --inplace ".\"extra-lib-dirs\" += [\"$VULKAN_SDK/lib/\"]" stack.yaml
200
+ yq --inplace ".\"extra-include-dirs\" += [\"$VULKAN_SDK/include/\"]" stack.yaml
201
+ printf "%s\n" "$VULKAN_SDK/bin" >> "$GITHUB_PATH"
202
+ if uname -s | grep -i mingw; then sep=';'; else sep=':'; fi
203
+ printf "%s\n" "PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}${sep}}$VULKAN_SDK/lib/pkgconfig" >> "$GITHUB_ENV"
204
+ # until this is fixed https://github.com/haskell/cabal/issues/7339
205
+ printf "%s\n" "DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}${sep}}$VULKAN_SDK/lib" >> "$GITHUB_ENV"
202
206
203
207
- name : Remove openxr
204
208
run : |
205
209
sed -ibak '/openxr/d' stack.yaml
206
210
207
211
- name : Install dependencies
212
+ shell : bash
208
213
run : stack build $ARGS --test --bench --only-dependencies
209
214
env :
210
215
ARGS : ${{ matrix.stack-args }}
211
216
212
217
- name : Build
218
+ shell : bash
213
219
run : stack build $ARGS
214
220
env :
215
221
ARGS : ${{ matrix.stack-args }}
216
222
217
223
- name : Build documentation
224
+ shell : bash
218
225
run : stack haddock $ARGS
219
226
env :
220
227
ARGS : ${{ matrix.stack-args }}
0 commit comments