File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -24,15 +24,13 @@ jobs:
24
24
submodules : recursive
25
25
- uses : actions/setup-python@v5
26
26
27
- - name : ccache
28
- uses : hendrikmuhs/ccache-action@v1
29
- with :
30
- key : apply-linters-${{ runner.os }}
31
- max-size : 1000M
27
+ - name : Install Python requirements
28
+ run : pip3 install -r requirements.txt
32
29
33
- - name : Build (Ubuntu 22.04)
30
+ - name : Configure CMake for lint-only build
34
31
run : |
35
- tools/ci-build.sh
32
+ mkdir -p build && cd build
33
+ cmake .. -DCMAKE_LINT_ONLY=ON
36
34
37
35
- name : Run cpplint on C/C++ files.
38
36
run : cmake --build build --target cpplint
43
41
- name : Run black and isort on Python files.
44
42
run : |
45
43
cmake --build build --target black
46
- cmake --build build --target isort
44
+ cmake --build build --target isort
Original file line number Diff line number Diff line change @@ -74,6 +74,22 @@ OPTION (ENABLE_UNIFIED_COMPILATION "Enable CMAKE_UNITY_BUILD" OFF)
74
74
# Enable DumpPipe pass output
75
75
OPTION (ENABLE_DUMP_PIPE "Enable DumpPipe pass output" ON )
76
76
77
+ option (CMAKE_LINT_ONLY "Only run linting/formatting targets without building p4c" OFF )
78
+
79
+ if (CMAKE_LINT_ONLY )
80
+ include (cmake/Linters.cmake )
81
+
82
+ # Add the existing linting targets here using the functions
83
+ add_cpplint_target ()
84
+ add_clang_format_target () # (if defined inside Linters.cmake)
85
+ add_cpplint_target ()
86
+ add_black_target ()
87
+
88
+ # Stop here, no further targets
89
+ return ()
90
+ endif ()
91
+
92
+
77
93
set (P4C_DRIVER_NAME "p4c" CACHE STRING "Customize the name of the driver script" )
78
94
79
95
set (MAX_LOGGING_LEVEL 10 CACHE STRING "Control the maximum logging level for -T logs" )
You can’t perform that action at this time.
0 commit comments