v2 / .github / workflows / other_ci.yml
190 lines · 175 sloc · 7.28 KB · a51ed8416224e15d17196584165f9fae71ec613f
Raw
1name: Other CI
2
3on:
4 workflow_dispatch:
5 push:
6 paths-ignore:
7 - '**.md'
8 - '**.yml'
9 - '!**/other_ci.yml'
10 - 'cmd/tools/**'
11 - '!cmd/tools/builders/**.v'
12 pull_request:
13 paths-ignore:
14 - '**.md'
15 - '**.yml'
16 - '!**/other_ci.yml'
17 - 'cmd/tools/**'
18 - '!cmd/tools/builders/**.v'
19
20concurrency:
21 group: other-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
22 cancel-in-progress: true
23
24jobs:
25 performance-compare-with-master:
26 runs-on: ubuntu-24.04
27 timeout-minutes: 30
28 steps:
29 - uses: actions/checkout@v6
30 with:
31 fetch-depth: 0
32 - name: Environment info
33 run: echo "$VFLAGS $GITHUB_SHA $GITHUB_REF"
34 - name: Name the local git branch
35 run: git checkout -b the_v_pr_branch
36 - name: Build local v
37 run: make && ./v symlink
38 - name: V version
39 run: ./v version
40 - name: Build the repeat tool
41 run: ./v cmd/tools/vrepeat.v
42 - name: Run compare_pr_to_master.v
43 run: VREPEAT_SILENT=1 ./v run .github/workflows/compare_pr_to_master.v
44
45 prevent-gpl-licenses:
46 runs-on: ubuntu-24.04
47 timeout-minutes: 20
48 steps:
49 - name: Checkout V ${{ github.head_ref }}
50 uses: actions/checkout@v6
51 with:
52 path: v
53 - name: Checkout V master
54 uses: actions/checkout@v6
55 with:
56 repository: vlang/v
57 path: vmaster
58 - name: Detect potentially added GPL licensed code
59 run: |
60 gpl_search_cmd="grep 'GPL' -r --exclude-dir=.git --exclude=*.yml --exclude=*.md --exclude=*.vv --exclude=*_test.v ."
61 cd vmaster
62 eval "$gpl_search_cmd" > ../gpl_res_vmaster
63 cd ../v
64 eval "$gpl_search_cmd" > ../gpl_res_vnew
65 cd ..
66 diff -d -a -U 2 --color=always gpl_res_vmaster gpl_res_vnew
67
68 code-formatting:
69 runs-on: ubuntu-24.04
70 timeout-minutes: 20
71 env:
72 VFLAGS: -cc gcc
73 steps:
74 - uses: actions/checkout@v6
75 - name: Environment info
76 run: echo "$VFLAGS $GITHUB_SHA $GITHUB_REF"
77 - name: Build local v
78 run: make -j4 && ./v symlink
79 - name: v test-cleancode
80 run: ./v -silent test-cleancode
81 - name: v test-fmt
82 run: ./v -silent test-fmt
83
84 performance-regressions:
85 runs-on: ubuntu-24.04
86 timeout-minutes: 20
87 env:
88 VFLAGS: -cc gcc
89 steps:
90 - uses: actions/checkout@v6
91 - name: Environment info
92 run: echo "$VFLAGS $GITHUB_SHA $GITHUB_REF"
93 - name: Build local v
94 run: make -j4 && ./v symlink
95 - name: Clone & Build previous vmaster/v
96 run: |
97 ./v retry -- git clone --depth=1 https://github.com/vlang/v vmaster/
98 (cd vmaster; make -j4)
99 - name: V versions
100 run: ./v version && ./vmaster/v version
101 - name: Build the repeat tool
102 run: ./v cmd/tools/vrepeat.v
103 - name: Repeat -o hw.c examples/hello_world.v
104 run: ./v repeat --max_time 280 --series 3 --runs 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -o hw.c examples/hello_world.v' . ./vmaster
105 - name: Repeat -o v.c cmd/v
106 run: ./v repeat --max_time 4000 --series 3 --runs 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -o v.c cmd/v' . ./vmaster
107
108 misc-tooling:
109 runs-on: ubuntu-24.04
110 timeout-minutes: 20
111 env:
112 VFLAGS: -cc tcc -no-retry-compilation
113 steps:
114 - uses: actions/checkout@v6
115 with:
116 fetch-depth: 10
117 - uses: ./.github/actions/cache-apt-packages-action
118 - name: Build v
119 run: make -j4 && ./v symlink
120
121 - name: Install dependencies
122 run: |
123 .github/workflows/disable_azure_mirror.sh
124 ./v retry -- sudo apt update
125 ./v retry -- sudo apt install --quiet -y libsodium-dev libssl-dev sqlite3 libsqlite3-dev postgresql libpq-dev valgrind
126 ./v retry -- sudo apt install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev libxrandr-dev libasound2-dev xfonts-75dpi xfonts-base libegl-dev
127 ./v retry -- sudo apt install --quiet -y g++-9 g++-10
128
129 - name: g++-9 version
130 run: g++-9 --version
131 - name: V self compilation with g++ and -std=c++11
132 run: ./v -cc g++-9 -no-std -cflags -std=c++11 -o v2 cmd/v && ./v2 -cc g++-9 -no-std -cflags -std=c++11 -o v3 cmd/v
133
134 - name: g++-10 version
135 run: g++-10 --version
136 - name: V self compilation with g++ and -std=c++20
137 run: ./v -cc g++-10 -no-std -cflags -std=c++20 -o v2 cmd/v && ./v2 -cc g++-10 -no-std -cflags -std=c++20 -o v3 cmd/v
138
139 # TODO: re-enable once autofree is fixed; see https://github.com/vlang/v/issues/27116
140 # - name: Ensure V can be compiled with -autofree
141 # run: ./v -autofree cmd/v
142
143 - name: Ensure V can be compiled with -no-closures
144 run: ./v -no-closures cmd/v
145
146 - name: Shader examples can be built
147 run: |
148 .github/workflows/compile_shaders_in_examples.sh
149 ./v should-compile-all examples/sokol/*.v examples/sokol/0?*/*.v
150
151 parser-silent:
152 runs-on: ubuntu-24.04
153 timeout-minutes: 30
154 steps:
155 - uses: actions/checkout@v6
156 - name: Build local v
157 run: |
158 make -j4 && ./v symlink
159 ./v -g -d trace_parse_stmt cmd/tools/vtest-parser.v
160 - name: Install zzuf
161 run: ./v retry -- sudo apt install -qq zzuf
162 - name: Run test-parser
163 run: |
164 ./v test-parser --show_source --linear examples/hello_world.v
165 ./v test-parser --show_source --linear examples/hanoi.v
166 ./v test-parser --show_source --linear examples/fibonacci.v
167 ./v test-parser --show_source --linear examples/cli.v
168 ./v test-parser --show_source --linear examples/json.v
169 ./v test-parser --show_source --linear examples/vmod.v
170 ./v test-parser --show_source --linear examples/regex/regex_example.v
171 ./v test-parser --show_source --linear examples/2048/2048.v
172
173 - name: Run test-parser over fuzzed files
174 run: |
175 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hello_world.v > examples/hello_world_fuzz.v
176 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hanoi.v > examples/hanoi_fuzz.v
177 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/fibonacci.v > examples/fibonacci_fuzz.v
178 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/cli.v > examples/cli_fuzz.v
179 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/json.v > examples/json_fuzz.v
180 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/vmod.v > examples/vmod_fuzz.v
181 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/regex/regex_example.v > examples/regex_example_fuzz.v
182 zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/2048/2048.v > examples/2048/2048_fuzz.v
183 ./v test-parser --show_source --linear examples/hello_world_fuzz.v
184 ./v test-parser --show_source --linear examples/fibonacci_fuzz.v
185 ./v test-parser --show_source --linear examples/hanoi_fuzz.v
186 ./v test-parser --show_source --linear examples/cli_fuzz.v
187 ./v test-parser --show_source --linear examples/json_fuzz.v
188 ./v test-parser --show_source --linear examples/vmod_fuzz.v
189 ./v test-parser --show_source --linear examples/regex_example_fuzz.v
190 ./v test-parser --show_source --linear examples/2048/2048_fuzz.v
191