-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Expand file tree
/
Copy pathv_apps_and_modules_compile_ci.yml
More file actions
317 lines (290 loc) · 12.2 KB
/
Copy pathv_apps_and_modules_compile_ci.yml
File metadata and controls
317 lines (290 loc) · 12.2 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
name: V Apps and Modules
on:
push:
branches:
- master
paths-ignore:
- 'vlib/v3/**'
- '**.md'
- '**.yml'
- '!**/v_apps_and_modules_compile_ci.yml'
- 'examples/**'
- 'cmd/tools/vrepl.v'
pull_request:
paths-ignore:
- 'vlib/v3/**'
- '**.md'
- '**.yml'
- '!**/v_apps_and_modules_compile_ci.yml'
- 'examples/**'
- 'cmd/tools/vrepl.v'
schedule:
- cron: '37 2 * * *'
permissions:
contents: read
concurrency:
group: v_apps-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
v-apps-compile:
if: ${{ github.event_name != 'schedule' || (github.repository == 'vlang/v' && github.ref == 'refs/heads/master') }}
strategy:
matrix:
os: [ubuntu-latest, macos-14]
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v7.0.1
- name: Cache apt packages
if: runner.os == 'Linux'
uses: ./.github/actions/cache-apt-packages-action
- name: Cache Homebrew downloads
if: runner.os == 'macOS'
uses: actions/cache@v6
with:
path: ~/Library/Caches/Homebrew
key: brew-${{ matrix.os }}-v_apps-${{ hashFiles('.github/workflows/v_apps_and_modules_compile_ci.yml') }}
restore-keys: |
brew-${{ matrix.os }}-v_apps-
brew-${{ matrix.os }}-
- name: Build V
id: build
run: make && sudo ./v symlink
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == 'Linux' ]; then
.github/workflows/disable_azure_mirror.sh
v retry -- sudo apt -qq update
v retry -- sudo apt -qq install libgc-dev libsodium-dev libssl-dev sqlite3 libsqlite3-dev
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
v retry -- sudo apt -qq install sassc libgit2-dev # needed by gitly
v retry -- sudo apt -qq install libunwind-18-dev # needed by v-analyzer for libbacktrace
else
v retry brew install sassc libgit2 libsodium pango fribidi pkg-config
fi
- name: Build docs generator
if: ${{ github.event_name != 'pull_request' && success() }}
run: |
v retry -- v install markdown
v retry -- git clone https://github.com/vlang/docs --branch generator --depth 1
cd docs
v .
- name: Test vtcc
if: ${{ github.event_name != 'pull_request' && runner.os == 'macOS' && success() }}
run: .github/workflows/compile_v_with_vtcc.sh
- name: Test vsql compilation and examples
if: ${{ false && !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Install vsql"
v retry -- v install elliotchance.vsql
cd ~/.vmodules/elliotchance/vsql
echo "Compile vsql"
make bin/vsql
echo "Run examples"
make examples
echo "Run vsql/connection_test.v"
v vsql/connection_test.v
- name: Test vlang/gui
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' }}
run: .github/workflows/compile_vlang_gui_examples.sh
- name: Test discord.v
if: ${{ false && !cancelled() && steps.build.outcome == 'success' }} # disabled: upstream uses deprecated json2.raw_decode
run: .github/workflows/compile_discordv.sh
- name: Build herolib
if: ${{ false && !cancelled() && steps.build.outcome == 'success' }}
run: .github/workflows/compile_herolib.sh
- name: Build vlang/vab
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Install VAB"
v retry -- v install vab
echo "Build vab"
v ~/.vmodules/vab
echo "Build vab with -g"
v -g ~/.vmodules/vab
- name: Build vlang/ved
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' }}
run: |
v retry -- git clone --depth 1 https://github.com/vlang/ved
cd ved && v -o ved .
echo "Build"
v .
echo "Build with -autofree ..."
v -autofree .
echo "Build with -prod ..."
v -prod .
cd ..
- name: Build vlang/pdf
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' }}
run: |
v retry -- v install pdf
echo "PDF examples should compile"
v should-compile-all ~/.vmodules/pdf/examples
- name: Build vlang/libsodium
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Install the libsodium wrapper"
v retry -- v install libsodium
echo "Test libsodium"
VJOBS=1 v test ~/.vmodules/libsodium
- name: Build vlang/coreutils
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Clone Coreutils"
v retry -- git clone --depth 1 https://github.com/vlang/coreutils /tmp/coreutils
echo "Build Coreutils"
cd /tmp/coreutils; make
- name: Build vlang/gitly
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Install markdown"
v retry -- v install markdown
echo "Install pcre"
v retry -- v install pcre
echo "Clone Gitly"
v retry -- git clone https://github.com/vlang/gitly /tmp/gitly
echo "Build Gitly"
v -cc gcc /tmp/gitly
## echo "Build Gitly with -autofree"
## v -cc gcc -autofree /tmp/gitly
echo "Compile gitly.css from gitly.scss"
sassc /tmp/gitly/static/css/gitly.scss > /tmp/gitly/static/css/gitly.css
# echo "Run first_run.v"
# v -cc gcc run /tmp/gitly/tests/first_run.v
# # /tmp/gitly/gitly -ci_run
- name: Build V UI examples
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' }}
run: |
v retry -- v install ui
v -no-parallel ~/.vmodules/ui/examples/rectangles.v
v -no-parallel ~/.vmodules/ui/examples/users.v
# v run ~/.vmodules/ui/examples/build_examples.vsh
- name: Build vlang/v-analyzer
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Clone v-analyzer"
v retry -- git clone --depth=1 --branch=master --filter=blob:none --recursive --shallow-submodules https://github.com/vlang/v-analyzer /tmp/v-analyzer
cd /tmp/v-analyzer
echo "Installing dependencies"
v install
echo "Build v-analyzer debug"
v build.vsh debug
echo "Build v-analyzer release"
VFLAGS=-w v build.vsh release
- name: Format vlang/v-analyzer
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
cd /tmp/v-analyzer
fmt_files=($(git ls-files '*.v' '*.vsh' ':!:metadata/stubs/*.v' ':!:src/metadata/stubs/*.v'))
set +e
v fmt -no-migrate-json2 -c "${fmt_files[@]}"
exit_code=$?
if [[ $exit_code -ne 0 && $exit_code -ne 5 ]]; then
# Don't fail if there are only internal errors (exit code 5).
v fmt -no-migrate-json2 -diff "${fmt_files[@]}"
exit 1
fi
- name: Build vlang/go2v
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' && matrix.os != 'macos-14' }}
run: |
echo "Clone Go2V"
v retry -- git clone --depth=1 https://github.com/vlang/go2v /tmp/go2v/
echo "Build Go2V"
v /tmp/go2v/
echo "Run Go2V tests"
VJOBS=1 v test /tmp/go2v/
- name: Install UI through VPM and make sure its examples compile
if: ${{ false && !cancelled() && steps.build.outcome == 'success' }} # disabled: upstream vlang/ui has unused parameter notices that fail with -N -W
run: |
echo "Official VPM modules should be installable"
v retry -- v install ui
echo "Examples of UI should compile"
v ~/.vmodules/ui/examples/build_examples.vsh
- name: Build vlang/adventofcode
if: ${{ github.event_name != 'pull_request' && !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Clone the AdventOfCode repo"
v retry -- git clone --depth 1 https://github.com/vlang/adventofcode /tmp/adventofcode
echo "Install dependencies"
v retry -- v install pcre
echo "Execute Tests"
cd /tmp/adventofcode && v run verify.v
- name: Build vlang/msgpack
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: |
echo "Install msgpack"
v retry -- v install msgpack
echo "Build msgpack"
v -shared ~/.vmodules/msgpack/
echo "Run msgpack tests"
v test ~/.vmodules/msgpack/
echo "MessagePack examples should compile"
v should-compile-all ~/.vmodules/msgpack/examples
# - name: Build VEX
# if: ${{ !cancelled() }} && steps.build.outcome == 'success'
# run: |
# echo "Install Vex"
# v retry -- v install nedpals.vex
# echo "Compile all of the Vex examples"
# v should-compile-all ~/.vmodules/nedpals/vex/examples
# echo "Compile the simple Vex example"
# v ~/.vmodules/nedpals/vex/examples/simple_example.v
# echo "Run Vex Tests"
# v test ~/.vmodules/nedpals/vex
vpm-site-compile:
if: ${{ github.event_name != 'pull_request' && (github.event_name != 'schedule' || (github.repository == 'vlang/v' && github.ref == 'refs/heads/master')) }}
strategy:
matrix:
os: [ubuntu-24.04, macos-14]
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v7.0.1
- name: Build V
run: make && ./v symlink
- name: Build vpm
run: |
v retry -- v install markdown
v retry -- git clone --depth 1 https://github.com/vlang/vpm
cd vpm && v .
# Compile gitly on Windows and run its tests/first_run.v smoke test. gitly
# serves its pages through veb, which uses the fasthttp backend, so this makes
# sure a real veb/fasthttp app both builds and returns the expected HTML on
# Windows (a regression test for the Windows fasthttp SOCKET truncation crash).
gitly-windows:
if: ${{ github.event_name != 'schedule' || (github.repository == 'vlang/v' && github.ref == 'refs/heads/master') }}
runs-on: windows-2025
timeout-minutes: 60
env:
VFLAGS: -cc gcc
GITLY_REPO: https://github.com/vlang/gitly
# TODO: switch back to the default branch once vlang/gitly#291 is merged.
GITLY_BRANCH: ci/windows-first-run
# Skip the tests that clone a remote GitHub repo; only run the pure
# "gitly serves the expected HTML" checks, which do not need network/git.
GITLY_TEST_SKIP_REMOTE_REPO: '1'
steps:
- uses: actions/checkout@v7.0.1
- name: Build V
run: |
.\makev.bat -gcc
.\v.exe symlink
- name: Install sqlite (gitly is built with -d sqlite)
run: .\.github\workflows\windows-install-sqlite.bat
- name: Install gitly module dependencies
run: |
v retry -- v install markdown
v retry -- v install pcre
- name: Clone gitly
run: v retry -- git clone --depth 1 -b $env:GITLY_BRANCH $env:GITLY_REPO gitly
- name: Compile gitly CSS
uses: gha-utilities/sass-build@v0.6.1
with:
source: gitly/static/css/gitly.scss
destination: gitly/static/css/gitly.css
- name: Compile and run gitly, then check that it serves the expected HTML
run: |
cd gitly
v -g run tests/first_run.v