GH-500 · Question #117
You are configuring a CodeQL workflow for compiled languages. What happens if your workflow uses a language matrix?
The correct answer is D. Autobuild attempts to build each of the languages listed in the matrix. When a CodeQL workflow uses a matrix strategy (e.g., matrix: language: [java, cpp]), GitHub's autobuild step runs a separate job for each language entry in the matrix and attempts to automatically detect and build that language's project. This is the expected behavior for…
Question
You are configuring a CodeQL workflow for compiled languages. What happens if your workflow uses a language matrix?
Options
- AAnalysis of other languages in your repository will fail unless you supply explicit build commands.
- BAutobuild attempts to build the supported language that has the most source files in the
- CYou may need to install additional software to use the autobuild process.
- DAutobuild attempts to build each of the languages listed in the matrix.
How the community answered
(35 responses)- A3% (1)
- B3% (1)
- D94% (33)
Explanation
When a CodeQL workflow uses a matrix strategy (e.g., matrix: language: [java, cpp]), GitHub's autobuild step runs a separate job for each language entry in the matrix and attempts to automatically detect and build that language's project. This is the expected behavior for multi-language compiled codebases. Choice A (other languages fail) describes a scenario for a single-language workflow that lacks explicit build commands, not a matrix workflow. Choice B describes an incorrect heuristic (most source files). Choice C is a concern for specific toolchains but is not a general statement about what happens with a matrix.
Topics
Community Discussion
No community discussion yet for this question.