10
10
CARGO_TERM_COLOR : always
11
11
12
12
jobs :
13
- queries :
14
- runs-on : ubuntu-latest
13
+ analyze :
14
+ runs-on : ubuntu-latest-xl
15
15
steps :
16
+ # ## Build the queries ###
16
17
- uses : actions/checkout@v3
17
18
- name : Find codeql
18
19
id : find-codeql
48
49
name : query-pack-zip
49
50
path : ${{ runner.temp }}/query-pack.zip
50
51
51
- extractors :
52
- runs-on : ubuntu-latest
53
-
54
- steps :
55
- - uses : actions/checkout@v3
52
+ # ## Build the extractor ###
56
53
- name : Cache entire extractor
57
54
id : cache-extractor
58
55
uses : actions/cache@v3
96
93
ql/target/release/ql-extractor
97
94
ql/target/release/ql-extractor.exe
98
95
retention-days : 1
99
- package :
100
- runs-on : ubuntu-latest
101
-
102
- needs :
103
- - extractors
104
- - queries
105
96
106
- steps :
107
- - uses : actions/checkout@v3
97
+ # ## Package the queries and extractor ###
108
98
- uses : actions/download-artifact@v3
109
99
with :
110
100
name : query-pack-zip
@@ -132,16 +122,8 @@ jobs:
132
122
name : codeql-ql-pack
133
123
path : codeql-ql.zip
134
124
retention-days : 1
135
- analyze :
136
- runs-on : ubuntu-latest
137
- strategy :
138
- matrix :
139
- folder : [cpp, csharp, java, javascript, python, ql, ruby, swift, go]
140
-
141
- needs :
142
- - package
143
125
144
- steps :
126
+ # ## Run the analysis ###
145
127
- name : Download pack
146
128
uses : actions/download-artifact@v3
147
129
with :
@@ -161,22 +143,18 @@ jobs:
161
143
env :
162
144
PACK : ${{ runner.temp }}/pack
163
145
164
- - name : Checkout repository
165
- uses : actions/checkout@v3
166
146
- name : Create CodeQL config file
167
147
run : |
168
- echo "paths:" > ${CONF}
169
- echo " - ${FOLDER}" >> ${CONF}
170
148
echo "paths-ignore:" >> ${CONF}
171
149
echo " - ql/ql/test" >> ${CONF}
150
+ echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
172
151
echo "disable-default-queries: true" >> ${CONF}
173
152
echo "packs:" >> ${CONF}
174
153
echo " - codeql/ql" >> ${CONF}
175
154
echo "Config file: "
176
155
cat ${CONF}
177
156
env :
178
157
CONF : ./ql-for-ql-config.yml
179
- FOLDER : ${{ matrix.folder }}
180
158
- name : Initialize CodeQL
181
159
uses : github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
182
160
with :
@@ -187,39 +165,24 @@ jobs:
187
165
- name : Perform CodeQL Analysis
188
166
uses : github/codeql-action/analyze@aa93aea877e5fb8841bcb1193f672abf6e9f2980
189
167
with :
190
- category : " ql-for-ql-${{ matrix.folder }} "
168
+ category : " ql-for-ql"
191
169
- name : Copy sarif file to CWD
192
- run : cp ../results/ql.sarif ./${{ matrix.folder }} .sarif
170
+ run : cp ../results/ql.sarif ./ql-for-ql .sarif
193
171
- name : Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
194
172
run : |
195
- sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ${{ matrix.folder }} .sarif
173
+ sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql .sarif
196
174
- name : Sarif as artifact
197
175
uses : actions/upload-artifact@v3
198
176
with :
199
- name : ${{ matrix.folder }}.sarif
200
- path : ${{ matrix.folder }}.sarif
201
-
202
- combine :
203
- runs-on : ubuntu-latest
204
- needs :
205
- - analyze
206
-
207
- steps :
208
- - uses : actions/checkout@v3
209
- - name : Make a folder for artifacts.
210
- run : mkdir -p results
211
- - name : Download all sarif files
212
- uses : actions/download-artifact@v3
213
- with :
214
- path : results
215
- - uses : actions/setup-node@v3
216
- with :
217
- node-version : 16
218
- - name : Combine all sarif files
219
- run : |
220
- node ./ql/scripts/merge-sarif.js results/**/*.sarif combined.sarif
221
- - name : Upload combined sarif file
177
+ name : ql-for-ql.sarif
178
+ path : ql-for-ql.sarif
179
+ - name : Split out the sarif file into langs
180
+ run : |
181
+ mkdir split-sarif
182
+ node ./ql/scripts/split-sarif.js ql-for-ql.sarif split-sarif
183
+ - name : Upload langs as artifacts
222
184
uses : actions/upload-artifact@v3
223
185
with :
224
- name : combined.sarif
225
- path : combined.sarif
186
+ name : ql-for-ql-langs
187
+ path : split-sarif
188
+ retention-days : 1
0 commit comments