v / .github / workflows / compile_vlang_gui_examples.sh
29 lines · 25 sloc · 920 bytes · b0e03b2fd3851e754dd3568b19328e1651d964d3
Raw
1#!/usr/bin/env bash
2
3set -e
4
5function show() {
6 printf "\u001b[35m$1\u001b[0m\n"
7}
8
9rm -rf ~/.vmodules/gui/ ~/.vmodules/vglyph/
10
11export VJOBS=1
12show "Clone https://github.com/vlang/vglyph"
13v retry -- git clone --filter=blob:none --quiet https://github.com/vlang/vglyph ~/.vmodules/vglyph/
14show "Use latest vlang/vglyph commit"
15git -C ~/.vmodules/vglyph/ log -1 --oneline
16show "Clone https://github.com/vlang/gui"
17v retry -- git clone --filter=blob:none --quiet https://github.com/vlang/gui ~/.vmodules/gui/
18show "Use latest vlang/gui commit"
19git -C ~/.vmodules/gui/ log -1 --oneline
20if [[ "$(uname)" == 'Darwin' ]]; then
21 export VFLAGS="${VFLAGS:-} -cc clang"
22fi
23show "Check module for syntax and semantic errors"
24v -shared -check ~/.vmodules/gui
25show "Execute Tests"
26v test ~/.vmodules/gui/
27show "Compile Examples"
28v should-compile-all -no-parallel ~/.vmodules/gui/examples/
29rm -rf ~/.vmodules/gui/ ~/.vmodules/vglyph/
30