v2 / .github / workflows / linux_ci.yml
180 lines · 175 sloc · 7.08 KB · a51ed8416224e15d17196584165f9fae71ec613f
Raw
1name: CI Linux
2
3on:
4 workflow_dispatch:
5 push:
6 paths-ignore:
7 - '**.md'
8 - '**.yml'
9 - '!**/linux_ci.yml'
10 - 'cmd/tools/**'
11 - '!cmd/tools/builders/**.v'
12 pull_request:
13 paths-ignore:
14 - '**.md'
15 - '**.yml'
16 - '!**/linux_ci.yml'
17 - 'cmd/tools/**'
18 - '!cmd/tools/builders/**.v'
19
20concurrency:
21 group: linux-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
22 cancel-in-progress: true
23
24jobs:
25 tcc-linux:
26 runs-on: ubuntu-24.04
27 timeout-minutes: 121
28 env:
29 VFLAGS: -cc tcc -no-retry-compilation
30 VTEST_SHOW_LONGEST_BY_RUNTIME: 3
31 VTEST_SHOW_LONGEST_BY_COMPTIME: 3
32 VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
33 steps:
34 - uses: actions/checkout@v6
35 - uses: ./.github/actions/cache-apt-packages-action
36 - name: Build v
37 run: make -j4 && ./v symlink
38 - name: Build v with -prealloc
39 run: v run ci/linux_ci.vsh build_v_with_prealloc
40 - name: All code is formatted
41 run: v run ci/linux_ci.vsh all_code_is_formatted_tcc
42 - name: Install dependencies for examples and tools
43 run: v run ci/linux_ci.vsh install_dependencies_for_examples_and_tools_tcc
44 - name: Test v->c
45 run: v run ci/linux_ci.vsh test_v_to_c_tcc
46 - name: v self compilation
47 run: v run ci/linux_ci.vsh v_self_compilation_tcc
48 - name: v doctor
49 run: v run ci/linux_ci.vsh v_doctor_tcc
50 - name: Verify `v test` works
51 run: v run ci/linux_ci.vsh verify_v_test_works_tcc
52 - name: Test pure V math module
53 run: v run ci/linux_ci.vsh test_pure_v_math_module_tcc
54 - name: Test inline assembly on linux
55 run: v run ci/linux_ci.vsh test_inline_assembly
56 - name: Self tests
57 run: v run ci/linux_ci.vsh self_tests_tcc
58 - name: Build examples
59 run: v run ci/linux_ci.vsh build_examples_tcc
60 - name: Run the submodule example, using a relative path
61 run: v run ci/linux_ci.vsh run_submodule_example_tcc
62 - name: Build v tools
63 run: v run ci/linux_ci.vsh build_tools_tcc
64 - name: Build v binaries
65 run: v run ci/linux_ci.vsh build_vbinaries_tcc
66 - name: Build benches
67 run: v run ci/linux_ci.vsh build_benches_tcc
68 - name: Run a VSH script
69 run: v run ci/linux_ci.vsh run_vsh_script_tcc
70 - name: Test v tutorials
71 run: v run ci/linux_ci.vsh test_v_tutorials_tcc
72 - name: Build cmd/tools/fast
73 run: v run ci/linux_ci.vsh build_fast_tcc
74 - name: V self compilation with -usecache
75 run: v run ci/linux_ci.vsh v_self_compilation_usecache_tcc
76 - name: Test password input
77 run: v run ci/linux_ci.vsh test_password_input_tcc
78 - name: Test readline
79 run: v run ci/linux_ci.vsh test_readline_tcc
80 - name: Test leak detector
81 run: v run ci/linux_ci.vsh test_leak_detector_tcc
82 - name: Test leak detector not being active for normal compile
83 run: v run ci/linux_ci.vsh test_leak_detector_not_active_tcc
84
85 gcc-linux:
86 runs-on: ubuntu-24.04
87 timeout-minutes: 121
88 env:
89 VTEST_SHOW_LONGEST_BY_RUNTIME: 3
90 VTEST_SHOW_LONGEST_BY_COMPTIME: 3
91 VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
92 steps:
93 - uses: actions/checkout@v6
94 - uses: ./.github/actions/cache-apt-packages-action
95 - name: Build V
96 run: make -j4 && ./v symlink
97 - name: All code is formatted
98 run: v run ci/linux_ci.vsh all_code_is_formatted_gcc
99 - name: Install dependencies for examples and tools
100 run: v run ci/linux_ci.vsh install_dependencies_for_examples_and_tools_gcc
101 - name: Recompile V with -cstrict and gcc
102 run: v run ci/linux_ci.vsh recompile_v_with_cstrict_gcc
103 - name: Valgrind v.c
104 run: v run ci/linux_ci.vsh valgrind_v_c_gcc
105 - name: Run sanitizers
106 run: v run ci/linux_ci.vsh run_sanitizers_gcc
107 - name: v self compilation
108 run: v run ci/linux_ci.vsh v_self_compilation_gcc
109 - name: v self compilation with -usecache
110 run: v run ci/linux_ci.vsh v_self_compilation_usecache_gcc
111 - name: Verify `v test` works
112 run: v run ci/linux_ci.vsh verify_v_test_works_gcc
113 - name: Test pure V math module
114 run: v run ci/linux_ci.vsh test_pure_v_math_module_gcc
115 - name: Self tests
116 run: v run ci/linux_ci.vsh self_tests_gcc
117 - name: Self tests (-prod)
118 run: v run ci/linux_ci.vsh self_tests_prod_gcc
119 - name: Self tests (-cstrict)
120 run: v run ci/linux_ci.vsh self_tests_cstrict_gcc
121 - name: Build examples
122 run: v run ci/linux_ci.vsh build_examples_gcc
123 - name: Build tetris with -autofree
124 run: v run ci/linux_ci.vsh build_tetris_autofree_gcc
125 - name: Build blog tutorial with -autofree
126 run: v run ci/linux_ci.vsh build_blog_autofree_gcc
127 - name: Build option_test.c.v with -autofree
128 run: v run ci/linux_ci.vsh build_option_test_autofree_gcc
129 - name: V self compilation with -parallel-cc
130 run: v run ci/linux_ci.vsh v_self_compilation_parallel_cc_gcc
131 - name: Build modules
132 run: v run ci/linux_ci.vsh build_modules_gcc
133 - name: compile vdoctor.v with -prod
134 run: v run ci/linux_ci.vsh compile_vdoctor_prod_gcc
135 - name: compile vup.v with -prod
136 run: v run ci/linux_ci.vsh compile_vup_prod_gcc
137
138 clang-linux:
139 runs-on: ubuntu-24.04
140 timeout-minutes: 121
141 env:
142 VFLAGS: -cc clang
143 VTEST_SHOW_LONGEST_BY_RUNTIME: 3
144 VTEST_SHOW_LONGEST_BY_COMPTIME: 3
145 VTEST_SHOW_LONGEST_BY_TOTALTIME: 3
146 steps:
147 - uses: actions/checkout@v6
148 - uses: ./.github/actions/cache-apt-packages-action
149 - name: Build V
150 run: make -j4 && ./v symlink
151 - name: All code is formatted
152 run: v run ci/linux_ci.vsh all_code_is_formatted_clang
153 - name: Install dependencies for examples and tools
154 run: v run ci/linux_ci.vsh install_dependencies_for_examples_and_tools_clang
155 - name: Recompile V with -cstrict and clang
156 run: v run ci/linux_ci.vsh recompile_v_with_cstrict_clang
157 - name: Valgrind
158 run: v run ci/linux_ci.vsh valgrind_clang
159 - name: Run sanitizers
160 run: v run ci/linux_ci.vsh run_sanitizers_clang
161 - name: v self compilation
162 run: v run ci/linux_ci.vsh v_self_compilation_clang
163 - name: v self compilation with -usecache
164 run: v run ci/linux_ci.vsh v_self_compilation_usecache_clang
165 - name: Verify `v test` works
166 run: v run ci/linux_ci.vsh verify_v_test_works_clang
167 - name: Test pure V math module
168 run: v run ci/linux_ci.vsh test_pure_v_math_module_clang
169 - name: Self tests
170 run: v run ci/linux_ci.vsh self_tests_clang
171 - name: Self tests (vprod)
172 run: v run ci/linux_ci.vsh self_tests_vprod_clang
173 - name: Self tests (-cstrict)
174 run: v run ci/linux_ci.vsh self_tests_cstrict_clang
175 - name: Build examples
176 run: v run ci/linux_ci.vsh build_examples_clang
177 - name: Build examples with -autofree
178 run: v run ci/linux_ci.vsh build_examples_autofree_clang
179 - name: Build modules
180 run: v run ci/linux_ci.vsh build_modules_clang
181