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