1010 CARGO_TERM_COLOR : always
1111
1212jobs :
13- queries :
14- runs-on : ubuntu-latest
13+ analyze :
14+ runs-on : ubuntu-latest-xl
1515 steps :
16+ # ## Build the queries ###
1617 - uses : actions/checkout@v3
1718 - name : Find codeql
1819 id : find-codeql
1920 uses : github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
2021 with :
2122 languages : javascript # does not matter
22- tools : latest
2323 - name : Get CodeQL version
2424 id : get-codeql-version
2525 run : |
4949 name : query-pack-zip
5050 path : ${{ runner.temp }}/query-pack.zip
5151
52- extractors :
53- strategy :
54- fail-fast : false
55-
56- runs-on : ubuntu-latest
57-
58- steps :
59- - uses : actions/checkout@v3
52+ # ## Build the extractor ###
6053 - name : Cache entire extractor
6154 id : cache-extractor
6255 uses : actions/cache@v3
@@ -100,15 +93,8 @@ jobs:
10093 ql/target/release/ql-extractor
10194 ql/target/release/ql-extractor.exe
10295 retention-days : 1
103- package :
104- runs-on : ubuntu-latest
105-
106- needs :
107- - extractors
108- - queries
10996
110- steps :
111- - uses : actions/checkout@v3
97+ # ## Package the queries and extractor ###
11298 - uses : actions/download-artifact@v3
11399 with :
114100 name : query-pack-zip
@@ -136,16 +122,8 @@ jobs:
136122 name : codeql-ql-pack
137123 path : codeql-ql.zip
138124 retention-days : 1
139- analyze :
140- runs-on : ubuntu-latest
141- strategy :
142- matrix :
143- folder : [cpp, csharp, java, javascript, python, ql, ruby, swift, go]
144-
145- needs :
146- - package
147125
148- steps :
126+ # ## Run the analysis ###
149127 - name : Download pack
150128 uses : actions/download-artifact@v3
151129 with :
@@ -165,39 +143,46 @@ jobs:
165143 env :
166144 PACK : ${{ runner.temp }}/pack
167145
168- - name : Checkout repository
169- uses : actions/checkout@v3
170146 - name : Create CodeQL config file
171147 run : |
172- echo "paths:" > ${CONF}
173- echo " - ${FOLDER}" >> ${CONF}
174148 echo "paths-ignore:" >> ${CONF}
175149 echo " - ql/ql/test" >> ${CONF}
150+ echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
176151 echo "disable-default-queries: true" >> ${CONF}
177152 echo "packs:" >> ${CONF}
178153 echo " - codeql/ql" >> ${CONF}
179154 echo "Config file: "
180155 cat ${CONF}
181156 env :
182157 CONF : ./ql-for-ql-config.yml
183- FOLDER : ${{ matrix.folder }}
184158 - name : Initialize CodeQL
185159 uses : github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
186160 with :
187161 languages : ql
188162 db-location : ${{ runner.temp }}/db
189163 config-file : ./ql-for-ql-config.yml
190- tools : latest
191164
192165 - name : Perform CodeQL Analysis
193166 uses : github/codeql-action/analyze@aa93aea877e5fb8841bcb1193f672abf6e9f2980
194167 with :
195- category : " ql-for-ql-${{ matrix.folder }} "
168+ category : " ql-for-ql"
196169 - name : Copy sarif file to CWD
197- run : cp ../results/ql.sarif ./${{ matrix.folder }}.sarif
170+ run : cp ../results/ql.sarif ./ql-for-ql.sarif
171+ - name : Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
172+ run : |
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
198174 - name : Sarif as artifact
199175 uses : actions/upload-artifact@v3
200176 with :
201- name : ${{ matrix.folder }}.sarif
202- path : ${{ matrix.folder }}.sarif
203-
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
184+ uses : actions/upload-artifact@v3
185+ with :
186+ name : ql-for-ql-langs
187+ path : split-sarif
188+ retention-days : 1
0 commit comments