1 | name: Other CI |
2 | |
3 | on: |
4 | push: |
5 | paths-ignore: |
6 | - "**.md" |
7 | pull_request: |
8 | paths-ignore: |
9 | - "**.md" |
10 | |
11 | concurrency: |
12 | group: build-other-${{ github.event.pull_request.number || github.sha }} |
13 | cancel-in-progress: true |
14 | |
15 | jobs: |
16 | no-gpl-by-accident: |
17 | runs-on: ubuntu-20.04 |
18 | if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' |
19 | timeout-minutes: 15 |
20 | steps: |
21 | - uses: actions/checkout@v3 |
22 | - name: No GPL licensed code, should be added accidentally |
23 | run: | |
24 | ! grep -r --exclude="*.yml" "a GPL license" . |
25 | |
26 | code-formatting: |
27 | runs-on: ubuntu-20.04 |
28 | if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' |
29 | timeout-minutes: 15 |
30 | env: |
31 | VFLAGS: -cc gcc |
32 | steps: |
33 | - uses: actions/checkout@v3 |
34 | - name: Environment info |
35 | run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF |
36 | - name: Build local v |
37 | run: make -j4 |
38 | - name: v test-cleancode |
39 | run: ./v test-cleancode |
40 | - name: v test-fmt |
41 | run: ./v test-fmt |
42 | |
43 | performance-regressions: |
44 | runs-on: ubuntu-20.04 |
45 | if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' |
46 | timeout-minutes: 15 |
47 | env: |
48 | VFLAGS: -cc gcc |
49 | steps: |
50 | - uses: actions/checkout@v3 |
51 | - name: Environment info |
52 | run: echo $VFLAGS $GITHUB_SHA $GITHUB_REF |
53 | - name: Build local v |
54 | run: make -j4 |
55 | - name: Clone & Build previous vmaster/v |
56 | run: | |
57 | git clone --depth=1 https://github.com/vlang/v vmaster/ |
58 | (cd vmaster; make -j4) |
59 | - name: V versions |
60 | run: ./v version && ./vmaster/v version |
61 | - name: Build the repeat tool |
62 | run: ./v cmd/tools/repeat.v |
63 | - name: Repeat -o hw.c examples/hello_world.v |
64 | run: cmd/tools/repeat --max_time 251 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o hw.c examples/hello_world.v' . ./vmaster |
65 | - name: Repeat -o v.c cmd/v |
66 | run: cmd/tools/repeat --max_time 1731 --series 3 --count 20 --nmins 2 --nmaxs 5 --warmup 3 --fail_percent 10 -t 'cd {T} ; ./v -show-timings -o v.c cmd/v' . ./vmaster |
67 | |
68 | misc-tooling: |
69 | runs-on: ubuntu-20.04 |
70 | if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' |
71 | timeout-minutes: 121 |
72 | env: |
73 | VFLAGS: -cc tcc -no-retry-compilation |
74 | steps: |
75 | - uses: actions/checkout@v3 |
76 | with: |
77 | fetch-depth: 10 |
78 | |
79 | - name: Install dependencies |
80 | run: | |
81 | sudo apt-get update |
82 | sudo apt-get install --quiet -y libsodium-dev libssl-dev sqlite3 libsqlite3-dev postgresql libpq-dev valgrind |
83 | sudo apt-get install --quiet -y libfreetype6-dev libxi-dev libxcursor-dev libgl-dev xfonts-75dpi xfonts-base |
84 | sudo apt-get install --quiet -y g++-9 g++-11 |
85 | |
86 | - name: Build v |
87 | run: make |
88 | |
89 | - name: g++-9 version |
90 | run: g++-9 --version |
91 | - name: V self compilation with g++ and -std=c++11 |
92 | 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 |
93 | |
94 | - name: g++-11 version |
95 | run: g++-11 --version |
96 | - name: V self compilation with g++ and -std=c++20 |
97 | run: ./v -cc g++-11 -no-std -cflags -std=c++20 -o v2 cmd/v && ./v2 -cc g++-11 -no-std -cflags -std=c++20 -o v3 cmd/v |
98 | |
99 | - name: Ensure V can be compiled with -autofree |
100 | run: ./v -autofree -o v2 cmd/v ## NB: this does not mean it runs, but at least keeps it from regressing |
101 | |
102 | - name: Shader examples can be build |
103 | run: | |
104 | wget https://github.com/floooh/sokol-tools-bin/raw/33d2e4cc26088c6c28eaef5467990f8940d15aab/bin/linux/sokol-shdc |
105 | chmod +x ./sokol-shdc |
106 | for f in examples/sokol/02_cubes_glsl/cube_glsl \ |
107 | examples/sokol/03_march_tracing_glsl/rt_glsl \ |
108 | examples/sokol/04_multi_shader_glsl/rt_glsl_puppy \ |
109 | examples/sokol/04_multi_shader_glsl/rt_glsl_march \ |
110 | examples/sokol/05_instancing_glsl/rt_glsl_instancing \ |
111 | examples/sokol/06_obj_viewer/gouraud \ |
112 | ; do \ |
113 | echo "compiling shader $f.glsl ..."; \ |
114 | ./sokol-shdc --input $f.glsl --output $f.h --slang glsl330 ; \ |
115 | done |
116 | ./v should-compile-all examples/sokol/*.v examples/sokol/0?*/*.v |
117 | |
118 | parser-silent: |
119 | runs-on: ubuntu-20.04 |
120 | if: github.event_name != 'push' || github.event.ref == 'refs/heads/master' || github.event.repository.full_name != 'vlang/v' |
121 | timeout-minutes: 121 |
122 | steps: |
123 | - uses: actions/checkout@v3 |
124 | - name: Install zzuf |
125 | run: sudo apt install -qq zzuf |
126 | - name: Build local v |
127 | run: | |
128 | make -j4 |
129 | ./v -g cmd/tools/vtest-parser.v |
130 | - name: Run test-parser |
131 | run: | |
132 | ./v test-parser -S examples/hello_world.v |
133 | ./v test-parser -S examples/hanoi.v |
134 | ./v test-parser -S examples/fibonacci.v |
135 | ./v test-parser -S examples/cli.v |
136 | ./v test-parser -S examples/json.v |
137 | ./v test-parser -S examples/vmod.v |
138 | ./v test-parser -S examples/regex/regex_example.v |
139 | ./v test-parser -S examples/2048/2048.v |
140 | |
141 | - name: Run test-parser over fuzzed files |
142 | run: | |
143 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hello_world.v > examples/hello_world_fuzz.v |
144 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/hanoi.v > examples/hanoi_fuzz.v |
145 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/fibonacci.v > examples/fibonacci_fuzz.v |
146 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/cli.v > examples/cli_fuzz.v |
147 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/json.v > examples/json_fuzz.v |
148 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/vmod.v > examples/vmod_fuzz.v |
149 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/regex/regex_example.v > examples/regex_example_fuzz.v |
150 | zzuf -R '\x00-\x20\x7f-\xff' -r0.01 < examples/2048/2048.v > examples/2048/2048_fuzz.v |
151 | ./v test-parser -S examples/hello_world_fuzz.v |
152 | ./v test-parser -S examples/hanoi_fuzz.v |
153 | ./v test-parser -S examples/cli_fuzz.v |
154 | ./v test-parser -S examples/regex_example_fuzz.v |
155 | ./v test-parser -S examples/2048/2048_fuzz.v |