Skip to content

Commit 588a28d

Browse files
committed
Merge remote-tracking branch 'origin/main' into platform_lang_pkg
2 parents 57b0b7f + a2cdfc8 commit 588a28d

20 files changed

+774
-156
lines changed

.github/workflows/integration-testing.yml

Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,297 @@ jobs:
150150
- uses: ./../action/analyze
151151
env:
152152
TEST_MODE: true
153+
154+
runner-analyze-javascript-ubuntu:
155+
runs-on: ubuntu-latest
156+
157+
steps:
158+
- uses: actions/checkout@v2
159+
160+
- name: Build runner
161+
run: |
162+
cd runner
163+
npm install
164+
npm run build-runner
165+
166+
- name: Run init
167+
run: |
168+
# Pass --config-file here, but not for other jobs in this workflow.
169+
# This means we're testing the config file parsing in the runner
170+
# but not slowing down all jobs unnecessarily as it doesn't add much
171+
# testing the parsing on different operating systems and languages.
172+
runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
173+
174+
- name: Run analyze
175+
run: |
176+
runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
177+
env:
178+
TEST_MODE: true
179+
180+
runner-analyze-javascript-windows:
181+
runs-on: windows-latest
182+
183+
steps:
184+
- uses: actions/checkout@v2
185+
186+
- name: Build runner
187+
run: |
188+
cd runner
189+
npm install
190+
npm run build-runner
191+
192+
- name: Run init
193+
run: |
194+
runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages javascript --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
195+
196+
- name: Run analyze
197+
run: |
198+
runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
199+
env:
200+
TEST_MODE: true
201+
202+
runner-analyze-javascript-macos:
203+
runs-on: macos-latest
204+
205+
steps:
206+
- uses: actions/checkout@v2
207+
208+
- name: Build runner
209+
run: |
210+
cd runner
211+
npm install
212+
npm run build-runner
213+
214+
- name: Run init
215+
run: |
216+
runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages javascript --config-file ./.github/codeql/codeql-config.yml --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
217+
218+
- name: Run analyze
219+
run: |
220+
runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
221+
env:
222+
TEST_MODE: true
223+
224+
runner-analyze-csharp-ubuntu:
225+
runs-on: ubuntu-latest
226+
227+
steps:
228+
- uses: actions/checkout@v2
229+
230+
- name: Move codeql-action
231+
shell: bash
232+
run: |
233+
mkdir ../action
234+
mv * .github ../action/
235+
mv ../action/tests/multi-language-repo/{*,.github} .
236+
237+
- name: Build runner
238+
run: |
239+
cd ../action/runner
240+
npm install
241+
npm run build-runner
242+
243+
- name: Run init
244+
run: |
245+
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
246+
247+
- name: Build code
248+
run: |
249+
. ./codeql-runner/codeql-env.sh
250+
dotnet build
251+
252+
- name: Run analyze
253+
run: |
254+
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
255+
env:
256+
TEST_MODE: true
257+
258+
runner-analyze-csharp-windows:
259+
runs-on: windows-latest
260+
261+
steps:
262+
- uses: actions/checkout@v2
263+
264+
- name: Move codeql-action
265+
shell: bash
266+
run: |
267+
mkdir ../action
268+
mv * .github ../action/
269+
mv ../action/tests/multi-language-repo/{*,.github} .
270+
271+
- name: Build runner
272+
run: |
273+
cd ../action/runner
274+
npm install
275+
npm run build-runner
276+
277+
- name: Run init
278+
run: |
279+
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
280+
281+
- name: Build code
282+
shell: powershell
283+
run: |
284+
cat ./codeql-runner/codeql-env.sh | Invoke-Expression
285+
dotnet build
286+
287+
- name: Run analyze
288+
run: |
289+
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
290+
env:
291+
TEST_MODE: true
292+
293+
runner-analyze-csharp-macos:
294+
runs-on: macos-latest
295+
296+
steps:
297+
- uses: actions/checkout@v2
298+
299+
- name: Move codeql-action
300+
shell: bash
301+
run: |
302+
mkdir ../action
303+
mv * .github ../action/
304+
mv ../action/tests/multi-language-repo/{*,.github} .
305+
306+
- name: Build runner
307+
run: |
308+
cd ../action/runner
309+
npm install
310+
npm run build-runner
311+
312+
- name: Run init
313+
run: |
314+
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
315+
316+
- name: Build code
317+
shell: bash
318+
run: |
319+
. ./codeql-runner/codeql-env.sh
320+
dotnet build
321+
322+
- name: Run analyze
323+
run: |
324+
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
325+
env:
326+
TEST_MODE: true
327+
328+
329+
runner-analyze-csharp-autobuild-ubuntu:
330+
runs-on: ubuntu-latest
331+
332+
steps:
333+
- uses: actions/checkout@v2
334+
335+
- name: Move codeql-action
336+
shell: bash
337+
run: |
338+
mkdir ../action
339+
mv * .github ../action/
340+
mv ../action/tests/multi-language-repo/{*,.github} .
341+
342+
- name: Build runner
343+
run: |
344+
cd ../action/runner
345+
npm install
346+
npm run build-runner
347+
348+
- name: Run init
349+
run: |
350+
../action/runner/dist/codeql-runner-linux init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
351+
352+
- name: Build code
353+
run: |
354+
../action/runner/dist/codeql-runner-linux autobuild
355+
356+
- name: Run analyze
357+
run: |
358+
../action/runner/dist/codeql-runner-linux analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
359+
env:
360+
TEST_MODE: true
361+
362+
runner-analyze-csharp-autobuild-windows:
363+
runs-on: windows-latest
364+
365+
steps:
366+
- uses: actions/checkout@v2
367+
368+
- name: Move codeql-action
369+
shell: bash
370+
run: |
371+
mkdir ../action
372+
mv * .github ../action/
373+
mv ../action/tests/multi-language-repo/{*,.github} .
374+
375+
- name: Build runner
376+
run: |
377+
cd ../action/runner
378+
npm install
379+
npm run build-runner
380+
381+
- name: Run init
382+
run: |
383+
../action/runner/dist/codeql-runner-win.exe init --repository $Env:GITHUB_REPOSITORY --languages csharp --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
384+
385+
- name: Build code
386+
shell: powershell
387+
run: |
388+
../action/runner/dist/codeql-runner-win.exe autobuild
389+
390+
- name: Run analyze
391+
run: |
392+
../action/runner/dist/codeql-runner-win.exe analyze --repository $Env:GITHUB_REPOSITORY --commit $Env:GITHUB_SHA --ref $Env:GITHUB_REF --github-url $Env:GITHUB_SERVER_URL --github-auth ${{ github.token }}
393+
env:
394+
TEST_MODE: true
395+
396+
runner-analyze-csharp-autobuild-macos:
397+
runs-on: macos-latest
398+
399+
steps:
400+
- uses: actions/checkout@v2
401+
402+
- name: Move codeql-action
403+
shell: bash
404+
run: |
405+
mkdir ../action
406+
mv * .github ../action/
407+
mv ../action/tests/multi-language-repo/{*,.github} .
408+
409+
- name: Build runner
410+
run: |
411+
cd ../action/runner
412+
npm install
413+
npm run build-runner
414+
415+
- name: Run init
416+
run: |
417+
../action/runner/dist/codeql-runner-macos init --repository $GITHUB_REPOSITORY --languages csharp --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
418+
419+
- name: Build code
420+
shell: bash
421+
run: |
422+
../action/runner/dist/codeql-runner-macos autobuild
423+
424+
- name: Run analyze
425+
run: |
426+
../action/runner/dist/codeql-runner-macos analyze --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}
427+
env:
428+
TEST_MODE: true
429+
430+
runner-upload-sarif:
431+
runs-on: ubuntu-latest
432+
433+
steps:
434+
- uses: actions/checkout@v2
435+
436+
- name: Build runner
437+
run: |
438+
cd runner
439+
npm install
440+
npm run build-runner
441+
442+
- name: Upload with runner
443+
run: |
444+
# Deliberately don't use TEST_MODE here. This is specifically testing
445+
# the compatibility with the API.
446+
runner/dist/codeql-runner-linux upload --sarif-file src/testdata/empty-sarif.sarif --repository $GITHUB_REPOSITORY --commit $GITHUB_SHA --ref $GITHUB_REF --github-url $GITHUB_SERVER_URL --github-auth ${{ github.token }}

.github/workflows/runner.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,23 @@ Use the `config-file` parameter of the `init` action to enable the configuration
9898
config-file: ./.github/codeql/codeql-config.yml
9999
```
100100

101-
The configuration file must be located within the local repository. For information on how to write a configuration file, see "[Using a custom configuration](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#using-a-custom-configuration)."
101+
The configuration file must be located within the local repository. For information on how to write a configuration file, see "[Using a custom configuration file](https://help.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#using-a-custom-configuration-file)."
102+
103+
If you only want to customise the queries used, you can specify them in your workflow instead of creating a config file, using the `queries` property of the `init` action:
104+
105+
```yaml
106+
- uses: github/codeql-action/init@v1
107+
with:
108+
queries: <local-or-remote-query>,<another-query>
109+
```
110+
111+
By default, this will override any queries specified in a config file. If you wish to use both sets of queries, prefix the list of queries in the workflow with `+`:
112+
113+
```yaml
114+
- uses: github/codeql-action/init@v1
115+
with:
116+
queries: +<local-or-remote-query>,<another-query>
117+
```
102118

103119
## Troubleshooting
104120

init/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ inputs:
1717
description: Path of the config file to use
1818
required: false
1919
queries:
20-
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file
20+
description: Comma-separated list of additional queries to run. By default, this overrides the same setting in a configuration file; prefix with "+" to use both sets of queries.
2121
required: false
2222
runs:
2323
using: 'node12'

0 commit comments

Comments
 (0)