v2 / .github / workflows / v_apps_and_modules_compile_ci.yml
264 lines · 239 sloc · 9.52 KB · ba60fc20382bc75dcb22e8e9db12bb32e45afc56
Raw
1name: V Apps and Modules
2
3on:
4 push:
5 paths-ignore:
6 - '**.md'
7 - '**.yml'
8 - '!**/v_apps_and_modules_compile_ci.yml'
9 - 'examples/**'
10 - 'cmd/tools/vrepl.v'
11 pull_request:
12 paths-ignore:
13 - '**.md'
14 - '**.yml'
15 - '!**/v_apps_and_modules_compile_ci.yml'
16 - 'examples/**'
17 - 'cmd/tools/vrepl.v'
18
19concurrency:
20 group: v_apps-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
21 cancel-in-progress: true
22
23jobs:
24 v-apps-compile:
25 strategy:
26 matrix:
27 os: [ubuntu-latest, macos-14]
28 fail-fast: false
29 runs-on: ${{ matrix.os }}
30 timeout-minutes: 60
31 steps:
32 - uses: actions/checkout@v6
33
34 - name: Cache apt packages
35 if: runner.os == 'Linux'
36 uses: ./.github/actions/cache-apt-packages-action
37
38 - name: Cache Homebrew downloads
39 if: runner.os == 'macOS'
40 uses: actions/cache@v4
41 with:
42 path: ~/Library/Caches/Homebrew
43 key: brew-${{ matrix.os }}-v_apps-${{ hashFiles('.github/workflows/v_apps_and_modules_compile_ci.yml') }}
44 restore-keys: |
45 brew-${{ matrix.os }}-v_apps-
46 brew-${{ matrix.os }}-
47
48 - name: Build V
49 id: build
50 run: make && sudo ./v symlink
51
52 - name: Install dependencies
53 run: |
54 if [ "$RUNNER_OS" == 'Linux' ]; then
55 .github/workflows/disable_azure_mirror.sh
56 v retry -- sudo apt -qq update
57 v retry -- sudo apt -qq install libgc-dev libsodium-dev libssl-dev sqlite3 libsqlite3-dev
58 v retry -- sudo apt -qq install libfreetype6-dev libxi-dev libxcursor-dev libgl-dev libxrandr-dev libasound2-dev xfonts-75dpi xfonts-base libegl-dev libharfbuzz-dev libfribidi-dev libfontconfig1-dev libpango1.0-dev libglib2.0-dev libdbus-1-dev
59 v retry -- sudo apt -qq install sassc libgit2-dev # needed by gitly
60 v retry -- sudo apt -qq install libunwind-18-dev # needed by v-analyzer for libbacktrace
61 else
62 v retry brew install sassc libgit2 libsodium pango fribidi pkg-config
63 fi
64
65 - name: Build docs generator
66 run: |
67 v retry -- v install markdown
68 v retry -- git clone https://github.com/vlang/docs --branch generator --depth 1
69 cd docs
70 v .
71
72 - name: Test vtcc
73 run: .github/workflows/compile_v_with_vtcc.sh
74
75 - name: Test vsql compilation and examples
76 if: ${{ false && !cancelled() && steps.build.outcome == 'success' }}
77 run: |
78 echo "Install vsql"
79 v retry -- v install elliotchance.vsql
80 cd ~/.vmodules/elliotchance/vsql
81 echo "Compile vsql"
82 make bin/vsql
83 echo "Run examples"
84 make examples
85 echo "Run vsql/connection_test.v"
86 v vsql/connection_test.v
87
88 - name: Test vlang/gui
89 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
90 run: .github/workflows/compile_vlang_gui_examples.sh
91 - name: Test discord.v
92 if: ${{ false && !cancelled() && steps.build.outcome == 'success' }} # disabled: upstream uses deprecated json2.raw_decode
93 run: .github/workflows/compile_discordv.sh
94 - name: Build herolib
95 if: ${{ false && !cancelled() && steps.build.outcome == 'success' }}
96 run: .github/workflows/compile_herolib.sh
97 - name: Build vlang/vab
98 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
99 run: |
100 echo "Install VAB"
101 v retry -- v install vab
102 echo "Build vab"
103 v ~/.vmodules/vab
104 echo "Build vab with -g"
105 v -g ~/.vmodules/vab
106
107 - name: Build vlang/ved
108 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
109 run: |
110 v retry -- git clone --depth 1 https://github.com/vlang/ved
111 cd ved && v -o ved .
112 echo "Build"
113 v .
114 echo "Build with -autofree ..."
115 v -autofree .
116 echo "Build with -prod ..."
117 v -prod .
118 cd ..
119
120 - name: Build vlang/pdf
121 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
122 run: |
123 v retry -- v install pdf
124 echo "PDF examples should compile"
125 v should-compile-all ~/.vmodules/pdf/examples
126
127 - name: Build vlang/libsodium
128 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
129 run: |
130 echo "Install the libsodium wrapper"
131 v retry -- v install libsodium
132 echo "Test libsodium"
133 VJOBS=1 v test ~/.vmodules/libsodium
134
135 - name: Build vlang/coreutils
136 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
137 run: |
138 echo "Clone Coreutils"
139 v retry -- git clone --depth 1 https://github.com/vlang/coreutils /tmp/coreutils
140 echo "Build Coreutils"
141 cd /tmp/coreutils; make
142
143 - name: Build vlang/gitly
144 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
145 run: |
146 echo "Install markdown"
147 v retry -- v install markdown
148 echo "Install pcre"
149 v retry -- v install pcre
150 echo "Clone Gitly"
151 v retry -- git clone https://github.com/vlang/gitly /tmp/gitly
152 echo "Build Gitly"
153 v -cc gcc /tmp/gitly
154 ## echo "Build Gitly with -autofree"
155 ## v -cc gcc -autofree /tmp/gitly
156 echo "Compile gitly.css from gitly.scss"
157 sassc /tmp/gitly/static/css/gitly.scss > /tmp/gitly/static/css/gitly.css
158 # echo "Run first_run.v"
159 # v -cc gcc run /tmp/gitly/tests/first_run.v
160 # # /tmp/gitly/gitly -ci_run
161
162 - name: Build V UI examples
163 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
164 run: |
165 v retry -- v install ui
166 v -no-parallel ~/.vmodules/ui/examples/rectangles.v
167 v -no-parallel ~/.vmodules/ui/examples/users.v
168 # v run ~/.vmodules/ui/examples/build_examples.vsh
169
170 - name: Build vlang/v-analyzer
171 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
172 run: |
173 echo "Clone v-analyzer"
174 v retry -- git clone --depth=1 --branch=master --filter=blob:none --recursive --shallow-submodules https://github.com/vlang/v-analyzer /tmp/v-analyzer
175 cd /tmp/v-analyzer
176 echo "Installing dependencies"
177 v install
178 echo "Build v-analyzer debug"
179 v build.vsh debug
180 echo "Build v-analyzer release"
181 v build.vsh release
182
183 - name: Format vlang/v-analyzer
184 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
185 run: |
186 cd /tmp/v-analyzer
187 fmt_files=($(git ls-files '*.v' '*.vsh' ':!:metadata/stubs/*.v' ':!:src/metadata/stubs/*.v'))
188 set +e
189 v fmt -c "${fmt_files[@]}"
190 exit_code=$?
191 if [[ $exit_code -ne 0 && $exit_code -ne 5 ]]; then
192 # Don't fail if there are only internal errors (exit code 5).
193 v fmt -diff "${fmt_files[@]}"
194 exit 1
195 fi
196
197 - name: Build vlang/go2v
198 if: ${{ !cancelled() && steps.build.outcome == 'success' && matrix.os != 'macos-14' }}
199 run: |
200 echo "Clone Go2V"
201 v retry -- git clone --depth=1 https://github.com/vlang/go2v /tmp/go2v/
202 echo "Build Go2V"
203 v /tmp/go2v/
204 echo "Run Go2V tests"
205 VJOBS=1 v test /tmp/go2v/
206
207 - name: Install UI through VPM and make sure its examples compile
208 if: ${{ false && !cancelled() && steps.build.outcome == 'success' }} # disabled: upstream vlang/ui has unused parameter notices that fail with -N -W
209 run: |
210 echo "Official VPM modules should be installable"
211 v retry -- v install ui
212 echo "Examples of UI should compile"
213 v ~/.vmodules/ui/examples/build_examples.vsh
214
215 - name: Build vlang/adventofcode
216 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
217 run: |
218 echo "Clone the AdventOfCode repo"
219 v retry -- git clone --depth 1 https://github.com/vlang/adventofcode /tmp/adventofcode
220 echo "Install dependencies"
221 v retry -- v install pcre
222 echo "Execute Tests"
223 cd /tmp/adventofcode && v run verify.v
224
225 - name: Build vlang/msgpack
226 if: ${{ !cancelled() && steps.build.outcome == 'success' }}
227 run: |
228 echo "Install msgpack"
229 v retry -- v install msgpack
230 echo "Build msgpack"
231 v -shared ~/.vmodules/msgpack/
232 echo "Run msgpack tests"
233 v test ~/.vmodules/msgpack/
234 echo "MessagePack examples should compile"
235 v should-compile-all ~/.vmodules/msgpack/examples
236
237 # - name: Build VEX
238 # if: ${{ !cancelled() }} && steps.build.outcome == 'success'
239 # run: |
240 # echo "Install Vex"
241 # v retry -- v install nedpals.vex
242 # echo "Compile all of the Vex examples"
243 # v should-compile-all ~/.vmodules/nedpals/vex/examples
244 # echo "Compile the simple Vex example"
245 # v ~/.vmodules/nedpals/vex/examples/simple_example.v
246 # echo "Run Vex Tests"
247 # v test ~/.vmodules/nedpals/vex
248
249 vpm-site-compile:
250 strategy:
251 matrix:
252 os: [ubuntu-24.04, macos-14]
253 fail-fast: false
254 runs-on: ${{ matrix.os }}
255 timeout-minutes: 20
256 steps:
257 - uses: actions/checkout@v6
258 - name: Build V
259 run: make && ./v symlink
260 - name: Build vpm
261 run: |
262 v retry -- v install markdown
263 v retry -- git clone --depth 1 https://github.com/vlang/vpm
264 cd vpm && v .
265