Skip to content

Commit 64e5c62

Browse files
henrymercerCopilot
andcommitted
Prepare per-language bundle graduation checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d9f196d4-6d15-44ca-bd01-cd022d57d2cc
1 parent ae098fa commit 64e5c62

4 files changed

Lines changed: 52 additions & 32 deletions

File tree

‎.github/workflows/__export-file-baseline-information.yml‎

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.github/workflows/__per-language-bundle-validation.yml‎

Lines changed: 20 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pr-checks/checks/export-file-baseline-information.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ installDotNet: true
1111
env:
1212
CODEQL_ACTION_SKIP_FILE_COVERAGE_ON_PRS: false
1313
CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE: true
14-
# To balance speed and coverage, we analyze only a single language (JavaScript), but use the
15-
# combined bundle so we can test that baseline information is reported for each language in the
16-
# multi-language source directory.
17-
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: false
14+
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: true
1815
steps:
1916
- uses: ./../action/init
2017
id: init
2118
with:
2219
languages: javascript
2320
tools: ${{ steps.prepare-test.outputs.tools-url }}
21+
# To balance speed and coverage, analyze only JavaScript but use the combined bundle so
22+
# baseline information is reported for every language in the multi-language repository. A
23+
# no-op custom configuration selects that conservative path for custom configurations.
24+
config: |
25+
paths-ignore: []
2426
- name: Build code
2527
run: ./build.sh
2628
- uses: ./../action/analyze

‎pr-checks/checks/per-language-bundle-validation.yml‎

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
name: Per-language bundles
22
description: Validates extraction and analysis using each per-language CodeQL bundle.
3-
# TODO: Use a released bundle once releases include per-language bundles.
43
matrix:
54
include:
65
- language: actions
76
os: ubuntu-latest
8-
version: nightly-latest
7+
version: linked
98
# Actions also needs the JavaScript extractor.
109
expected-extractors: actions javascript
1110
- language: cpp
1211
os: ubuntu-latest
13-
version: nightly-latest
12+
version: linked
1413
build-mode: manual
1514
build-command: gcc -o main main.c
1615
- language: csharp
1716
os: ubuntu-latest
18-
version: nightly-latest
17+
version: linked
1918
build-mode: none
2019
- language: go
2120
os: ubuntu-latest
22-
version: nightly-latest
21+
version: linked
2322
build-mode: autobuild
2423
- language: java
2524
os: ubuntu-latest
26-
version: nightly-latest
25+
version: linked
2726
build-mode: none
2827
- language: javascript
2928
os: ubuntu-latest
30-
version: nightly-latest
29+
version: linked
3130
- language: python
3231
os: ubuntu-latest
33-
version: nightly-latest
32+
version: linked
3433
- language: ruby
3534
os: ubuntu-latest
36-
version: nightly-latest
35+
version: linked
3736
- language: rust
3837
os: ubuntu-latest
39-
version: nightly-latest
38+
version: linked
4039
- language: swift
4140
os: macos-latest-xlarge
42-
version: nightly-latest
41+
version: linked
4342
build-mode: autobuild
4443
env:
4544
CODEQL_ACTION_PER_LANGUAGE_BUNDLES: true
4645
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 });
4754
- uses: ./../action/init
4855
id: init
4956
with:
@@ -84,9 +91,8 @@ steps:
8491
CODEQL_PATH: ${{ steps.init.outputs.codeql-path }}
8592
run: |
8693
# 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.
9096
echo "CodeQL is at $CODEQL_PATH"
9197
if [[ "$CODEQL_PATH" == "$RUNNER_TOOL_CACHE"/* ]]; then
9298
echo "::error::The per-language bundle was added to the toolcache at $CODEQL_PATH."

0 commit comments

Comments
 (0)