55 push :
66 branches :
77 - main
8- - " rc/**"
98 - next
109 pull_request :
1110 branches :
1211 - main
13- - " rc/**"
1412 - next
1513
16- env :
17- XARGS_MAX_PROCS : 4
14+ permissions :
15+ contents : read
16+ actions : write
1817
1918jobs :
2019 validate-package-files :
2120 name : Validate Package Files
22- runs-on : ubuntu-22.04
23- steps :
24- - name : Checkout
25- uses : actions/checkout@v2
21+ uses : ./.github/workflows/validate-package-files.yml
22+ with :
23+ ref : ${{ github.ref }}
2624
27- - name : Install Python
28- uses : actions/setup-python@v4
29- with :
30- python-version : " 3.9"
31-
32- - name : Install CodeQL
33- run : |
34- VERSION="v$( jq -r '.supported_environment | .[0] | .codeql_cli' supported_codeql_configs.json)"
35- gh extensions install github/gh-codeql
36- gh codeql set-version "$VERSION"
37- gh codeql install-stub
38- env :
39- GITHUB_TOKEN : ${{ github.token }}
40-
41- - name : Install generate_package_files.py dependencies
42- run : pip install -r scripts/requirements.txt
43-
44- - name : Validate Package Descriptions (CPP)
45- run : |
46- python scripts/validate-rule-package.py rule_packages/cpp/*.json
47-
48- - name : Validate Package Descriptions (C)
49- run : |
50- python scripts/validate-rule-package.py rule_packages/c/*.json
51-
52- - name : Validate Package Descriptions consistency (CPP)
53- run : |
54- python scripts/verify_rule_package_consistency.py cpp
55-
56- - name : Validate Package Descriptions consistency (C)
57- run : |
58- python scripts/verify_rule_package_consistency.py c
59-
60- - name : Validate Package Files (CPP)
61- run : |
62- find rule_packages/cpp -name \*.json -exec basename {} .json \; | xargs python scripts/generate_rules/generate_package_files.py cpp
63- git diff
64- git diff --compact-summary
65- git diff --quiet
66-
67- - name : Validate Package Files (C)
68- run : |
69- find rule_packages/c -name \*.json -exec basename {} .json \; | xargs python scripts/generate_rules/generate_package_files.py c
70- git diff
71- git diff --compact-summary
72- git diff --quiet
73-
74- validate-codeql-format :
75- name : " Validate CodeQL Format"
76- runs-on : ubuntu-22.04
77- steps :
78- - name : Checkout
79- uses : actions/checkout@v2
80-
81- - name : Install CodeQL
82- run : |
83- VERSION="v$( jq -r '.supported_environment | .[0] | .codeql_cli' supported_codeql_configs.json)"
84- gh extensions install github/gh-codeql
85- gh codeql set-version "$VERSION"
86- gh codeql install-stub
87- env :
88- GITHUB_TOKEN : ${{ github.token }}
89-
90- - name : Validate CodeQL Format (CPP)
91- run : |
92- find cpp -name \*.ql -or -name \*.qll -print0 | xargs -0 --max-procs "$XARGS_MAX_PROCS" codeql query format --in-place
93-
94- git diff
95- git diff --compact-summary
96- git diff --quiet
97-
98- - name : Validate CodeQL Format (C)
99- run : |
100- find c -name \*.ql -or -name \*.qll -print0 | xargs -0 --max-procs "$XARGS_MAX_PROCS" codeql query format --in-place
101-
102- git diff
103- git diff --compact-summary
104- git diff --quiet
25+ validate-codeql-query-formatting :
26+ name : " Validate CodeQL Query Formatting"
27+ uses : ./.github/workflows/validate-query-formatting.yml
28+ with :
29+ ref : ${{ github.ref }}
10530
10631 validate-query-help-files :
10732 name : Validate Query Help Files
108- runs-on : ubuntu-22.04
109- steps :
110- - name : Checkout
111- uses : actions/checkout@v2
112-
113- - name : Validate CPP Query Help Files
114- run : |
115- exit_code=0
116- for help_file in `find cpp -name '*.md'`
117- do
118- if grep -F -q 'REPLACE THIS' "$help_file" > /dev/null
119- then
120- echo "Help file $help_file contains placeholders that are not replaced or removed!"
121- exit_code=1
122- fi
123- done
124-
125- exit $exit_code
126-
127- - name : Validate C Query Help Files
128- run : |
129- exit_code=0
130- for help_file in `find c -name '*.md'`
131- do
132- if grep -F -q 'REPLACE THIS' "$help_file" > /dev/null
133- then
134- echo "Help file $help_file contains placeholders that are not replaced or removed!"
135- exit_code=1
136- fi
137- done
138-
139- exit $exit_code
140-
141- validate-cpp-test-files :
142- name : Validate C++ Test Files
143- runs-on : ubuntu-22.04
144- steps :
145- - name : Checkout
146- uses : actions/checkout@v2
147-
148- - name : Install clang-format
149- run : |
150- sudo apt-get install --yes --quiet --no-install-recommends clang-format
151- echo "::debug::$(clang-format -version)"
152-
153- - name : Validate C++ Test Files
154- run : |
155- if ! test -f .clang-format; then
156- echo "Cannot find .clang-format in '$PWD'. Exiting..."
157- fi
158-
159- find cpp/*/test -name \*.cpp -print0 | xargs -0 --max-procs "$XARGS_MAX_PROCS" clang-format --style=file -i --verbose
160- git diff
161- git diff --compact-summary
162- git diff --quiet
163-
164- validate-c-test-files :
165- name : Validate C Test Files
166- runs-on : ubuntu-22.04
167- steps :
168- - name : Checkout
169- uses : actions/checkout@v2
170-
171- - name : Install clang-format
172- run : |
173- sudo apt-get install --yes --quiet --no-install-recommends clang-format
174- echo "::debug::$(clang-format -version)"
175-
176- - name : Validate C++ Test Files
177- run : |
178- if ! test -f .clang-format; then
179- echo "Cannot find .clang-format in '$PWD'. Exiting..."
180- fi
181-
182- find c/*/test -name \*.c -print0 | xargs -0 --max-procs "$XARGS_MAX_PROCS" clang-format --style=file -i --verbose
183- git diff
184- git diff --compact-summary
185- git diff --quiet
33+ uses : ./.github/workflows/validate-query-help.yml
34+ with :
35+ ref : ${{ github.ref }}
36+
37+ validate-test-case-formatting :
38+ name : Validate Test
39+ uses : ./.github/workflows/validate-query-test-case-formatting.yml
40+ with :
41+ ref : ${{ github.ref }}
0 commit comments