|
1 | 1 | name: Per-language bundles |
2 | 2 | description: Validates extraction and analysis using each per-language CodeQL bundle. |
3 | | -# TODO: Use a released bundle once releases include per-language bundles. |
4 | 3 | matrix: |
5 | 4 | include: |
6 | 5 | - language: actions |
7 | 6 | os: ubuntu-latest |
8 | | - version: nightly-latest |
| 7 | + version: linked |
9 | 8 | # Actions also needs the JavaScript extractor. |
10 | 9 | expected-extractors: actions javascript |
11 | 10 | - language: cpp |
12 | 11 | os: ubuntu-latest |
13 | | - version: nightly-latest |
| 12 | + version: linked |
14 | 13 | build-mode: manual |
15 | 14 | build-command: gcc -o main main.c |
16 | 15 | - language: csharp |
17 | 16 | os: ubuntu-latest |
18 | | - version: nightly-latest |
| 17 | + version: linked |
19 | 18 | build-mode: none |
20 | 19 | - language: go |
21 | 20 | os: ubuntu-latest |
22 | | - version: nightly-latest |
| 21 | + version: linked |
23 | 22 | build-mode: autobuild |
24 | 23 | - language: java |
25 | 24 | os: ubuntu-latest |
26 | | - version: nightly-latest |
| 25 | + version: linked |
27 | 26 | build-mode: none |
28 | 27 | - language: javascript |
29 | 28 | os: ubuntu-latest |
30 | | - version: nightly-latest |
| 29 | + version: linked |
31 | 30 | - language: python |
32 | 31 | os: ubuntu-latest |
33 | | - version: nightly-latest |
| 32 | + version: linked |
34 | 33 | - language: ruby |
35 | 34 | os: ubuntu-latest |
36 | | - version: nightly-latest |
| 35 | + version: linked |
37 | 36 | - language: rust |
38 | 37 | os: ubuntu-latest |
39 | | - version: nightly-latest |
| 38 | + version: linked |
40 | 39 | - language: swift |
41 | 40 | os: macos-latest-xlarge |
42 | | - version: nightly-latest |
| 41 | + version: linked |
43 | 42 | build-mode: autobuild |
44 | 43 | env: |
45 | 44 | CODEQL_ACTION_PER_LANGUAGE_BUNDLES: true |
46 | 45 | steps: |
| 46 | + - name: Remove CodeQL from toolcache |
| 47 | + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 |
| 48 | + with: |
| 49 | + script: | |
| 50 | + const fs = require('fs'); |
| 51 | + const path = require('path'); |
| 52 | + const codeqlPath = path.join(process.env['RUNNER_TOOL_CACHE'], 'CodeQL'); |
| 53 | + fs.rmdirSync(codeqlPath, { recursive: true }); |
47 | 54 | - uses: ./../action/init |
48 | 55 | id: init |
49 | 56 | with: |
|
84 | 91 | CODEQL_PATH: ${{ steps.init.outputs.codeql-path }} |
85 | 92 | run: | |
86 | 93 | # A bundle that is missing most of its extractors must never be left in the toolcache, |
87 | | - # where a later job analyzing a different language could pick it up. The runner image |
88 | | - # ships with its own CodeQL in the toolcache, so check where this bundle was extracted to |
89 | | - # rather than whether the toolcache contains CodeQL at all. |
| 94 | + # where a later job analyzing a different language could pick it up. Per-language bundles |
| 95 | + # must instead be extracted under the runner's temporary directory. |
90 | 96 | echo "CodeQL is at $CODEQL_PATH" |
91 | 97 | if [[ "$CODEQL_PATH" == "$RUNNER_TOOL_CACHE"/* ]]; then |
92 | 98 | echo "::error::The per-language bundle was added to the toolcache at $CODEQL_PATH." |
|
0 commit comments