-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
258 lines (246 loc) · 8.21 KB
/
Copy pathtools_ci.yml
File metadata and controls
258 lines (246 loc) · 8.21 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
name: Tools CI
on:
push:
branches:
- master
paths:
- 'cmd/**'
- '!cmd/tools/vpm/**'
- 'vlib/**'
- 'thirdparty/**'
- '!**.md'
- '**/tools_ci.yml'
pull_request:
paths:
- 'cmd/**'
- '!cmd/tools/vpm/**'
- 'vlib/**'
- 'thirdparty/**'
- '!**.md'
- '**/tools_ci.yml'
concurrency:
group: tools-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
jobs:
tools-linux:
runs-on: ubuntu-22.04
timeout-minutes: 20
strategy:
matrix:
cc: [tcc, gcc, clang]
fail-fast: false
env:
VFLAGS: -cc ${{ matrix.cc }}
steps:
- uses: actions/checkout@v7
- name: Build V
run: make && ./v -showcc -o v cmd/v && ./v symlink && ./v doctor
- name: Code in cmd/ is formatted
run: ./v fmt -verify cmd/
- name: Check build-tools
run: ./v -silent -N -W -check build-tools
- name: Test tools
run: ./v -silent test-self cmd
- name: Test tools (-cstrict)
if: ${{ matrix.cc != 'tcc' }}
run: ./v -silent -W -cstrict test-self cmd
- name: Test sanitized
if: ${{ matrix.cc != 'tcc' }}
run: |
export VNATIVE_SKIP_LIBC_VV=1
if [[ ${{ matrix.cc }} == "clang" ]]; then
cmd="./v -silent -cc clang -cflags -fsanitize=undefined test-self -ubsan-compiler cmd"
echo "$cmd" && $cmd
cmd="./v -silent -gc none -cc clang -cflags -fsanitize=memory test-self -msan-compiler cmd"
echo "$cmd" && $cmd
else
cmd="./v -silent -cc gcc -cflags -fsanitize=thread test-self cmd"
echo "$cmd" && $cmd
cmd="./v -silent -cc gcc -cflags -fsanitize=address,leak,undefined,shift,shift-exponent,shift-base,integer-divide-by-zero,unreachable,vla-bound,null,return,signed-integer-overflow,bounds,bounds-strict,alignment,object-size,float-divide-by-zero,float-cast-overflow,nonnull-attribute,returns-nonnull-attribute,bool,enum,vptr test-self -asan-compiler cmd/tools"
echo "$cmd" && $cmd
## cmd="./v -silent -cc gcc -cflags -fsanitize=kernel-address test-self -asan-compiler cmd"
## echo "$cmd" && $cmd
fi
tools-macos:
runs-on: macos-14
timeout-minutes: 20
strategy:
matrix:
cc: [clang]
fail-fast: false
env:
VFLAGS: -cc ${{ matrix.cc }}
steps:
- uses: actions/checkout@v7
- name: Build V
run: make && ./v -showcc -o v cmd/v && ./v symlink && ./v doctor
- name: Check build-tools
run: ./v -silent -N -W -check build-tools
- name: Test tools
run: ./v -silent test-self cmd
- name: Test tools (-cstrict)
run: ./v -silent -W -cstrict test-self cmd
tools-windows:
runs-on: windows-2025
timeout-minutes: 20
strategy:
matrix:
cc: [tcc, gcc, msvc]
fail-fast: false
env:
VFLAGS: -cc ${{ matrix.cc }}
steps:
- uses: actions/checkout@v7
- name: Build V
run: ./makev.bat -${{ matrix.cc }} && ./v -o v2.exe cmd/v && ./v2 -showcc -o v.exe cmd/v && ./v symlink && ./v doctor
- name: Install SQLite (needed by vsqlite tool)
run: .\.github\workflows\windows-install-sqlite.bat
- name: Check build tools
run: ./v build-tools
- name: Test tools
run: ./v -silent test-self cmd
- name: Test tools (-cstrict)
if: ${{ matrix.cc == 'msvc' }}
run: ./v -silent -W -cstrict test-self cmd
tools-docker-ubuntu-musl:
runs-on: ubuntu-24.04
timeout-minutes: 20
container:
image: thevlang/vlang:ubuntu-build
env:
V_CI_MUSL: 1
V_CI_UBUNTU_MUSL: 1
VFLAGS: -cc musl-gcc -gc none
volumes:
- ${{github.workspace}}:/opt/vlang
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Build V
run: make && ./v -cg -o v cmd/v && ./v symlink
- name: Ensure git commands can be used with no prompts on modern Git versions
run: git config --global --add safe.directory /__w/v/v
- name: Verify `v test` works
run: |
./v cmd/tools/test_if_v_test_system_works.v
./cmd/tools/test_if_v_test_system_works
- name: Check build tools
run: ./v -silent -N -W -check build-tools
- name: Test tools
run: ./v -silent test-self cmd
- name: Test tools (-cstrict)
run: ./v -silent -W -cstrict test-self cmd
tools-freebsd:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
cc: [tcc, gcc, clang]
fail-fast: false
env:
VFLAGS: -cc ${{ matrix.cc }}
steps:
- uses: actions/checkout@v7
- name: Start FreeBSD VM with ${{ matrix.cc }}
uses: cross-platform-actions/action@v1.2.0
with:
operating_system: freebsd
version: '15.0'
memory: 4G
shell: sh
sync_files: runner-to-vm
environment_variables: VFLAGS
- name: Tests tools on FreeBSD with ${{ matrix.cc }}
shell: cpa.sh {0}
run: |
sudo pkg install -y git sqlite3 gmake boehm-gc-threaded libiconv
if [ "$VFLAGS" = "-cc gcc" ]; then
sudo pkg install -y gcc
fi
# Mandatory: hostname not set in VM => some tests fail
sudo hostname -s freebsd-ci
echo "::group::OS infos"
uname -a
echo "::endgroup::"
# Build V
echo "::group::Build V"
git config --global --add safe.directory .
printf "VFLAGS = %s\n" "$VFLAGS"
gmake && ./v -showcc -o v cmd/v && sudo ./v symlink
echo "::endgroup::"
echo "::group::v doctor"
./v doctor
echo "::endgroup::"
# Code in cmd/ is formatted
echo "::group::Check code in cmd/ is formatted"
./v fmt -verify cmd/
echo "::endgroup::"
# Check build-tools
echo "::group::Check build tools"
./v -silent -N -W -check build-tools
echo "::endgroup::"
# Test tools
echo "::group::Test tools"
./v -silent test-self cmd
echo "::endgroup::"
# Test tools (-cstrict)
if [ "$VFLAGS" != "-cc tcc" ]; then
echo "::group::Test tools (-cstrict)"
./v -silent -W -cstrict test-self cmd
echo "::endgroup::"
fi
tools-openbsd:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
cc: [tcc, clang]
fail-fast: false
env:
VFLAGS: -cc ${{ matrix.cc }}
steps:
- uses: actions/checkout@v7
- name: Start OpenBSD VM with ${{ matrix.cc }}
uses: cross-platform-actions/action@v1.2.0
with:
operating_system: openbsd
version: '7.8'
memory: 4G
sync_files: runner-to-vm
environment_variables: VFLAGS
- name: Tests tools on OpenBSD with ${{ matrix.cc }}
shell: cpa.sh {0}
run: |
sudo pkg_add git sqlite3 gmake boehm-gc libiconv
# Mandatory: hostname not set in VM => some tests fail
sudo hostname -s openbsd-ci
echo "::group::OS infos"
uname -a
echo "::endgroup::"
# Build V
echo "::group::Build V"
git config --global --add safe.directory .
printf "VFLAGS = %s\n" "$VFLAGS"
gmake && ./v -showcc -o v cmd/v && sudo ./v symlink
echo "::endgroup::"
echo "::group::v doctor"
./v doctor
echo "::endgroup::"
# Code in cmd/ is formatted
echo "::group::Check code in cmd/ is formatted"
./v fmt -verify cmd/
echo "::endgroup::"
# Check build-tools
echo "::group::Check build tools"
./v -silent -N -W -check build-tools
echo "::endgroup::"
# Test tools
echo "::group::Test tools"
./v -silent test-self cmd
echo "::endgroup::"
# Test tools (-cstrict)
if [ "$VFLAGS" != "-cc tcc" ]; then
echo "::group::Test tools (-cstrict)"
./v -silent -W -cstrict test-self cmd
echo "::endgroup::"
fi