Speed up build in Codeql workflow #28654
Replies: 1 comment
-
Greetings, and thanks for getting in touch with this question! Firstly, my apologies for the slow response here, it looks like this slipped through the cracks of our triaging. Unfortunately, in order for CodeQL to be able to properly analyze your code it needs to observe the full build process and therefore we typically do need a full build of the code being analyzed in order for this to work. However, I can recommend that if you're building any dependencies that you do not need to analyze as part of your build then you could cache this part of the build and restore it before running CodeQL. Also, if your build target includes running tests, you can often cut down the time of your workflow by making a smaller build target for CodeQL that doesn't run these tests. Let me know how you get on with the above suggestions, and if the repository you're working in is public I'd also be happy to take a further look at this for you! |
Beta Was this translation helpful? Give feedback.
-
In our Go repository we employ different mechanisms in order to speed-up or completely avoid re-building the final binary in each workflow. For example, we use
actions/cache
andactions/upload-artifact
GitHub actions.For the CodeQL workflow, it seems none of these work and the analyze action ends up building the full binary anyway, resulting in a lengthy runtime of approx. 50 minutes. Is there any way to shorten that time, and avoid the full build?
Beta Was this translation helpful? Give feedback.
All reactions