You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages.md
+41
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,12 @@ The basic {% data variables.code-scanning.codeql_workflow %} uses the `autobuild
50
50
51
51
{% endif %}
52
52
53
+
{% ifversion codeql-dependency-caching %}
54
+
55
+
You can use dependency caching with {% data variables.product.prodname_codeql %} to store dependencies as a {% data variables.product.prodname_actions %} cache instead of downloading them from registries. For more information, see "[About dependency caching for {% data variables.product.prodname_codeql %}](#about-dependency-caching-for-codeql)" later in this article.
56
+
57
+
{% endif %}
58
+
53
59
{% ifversion codeql-no-build %}
54
60
55
61
## {% data variables.product.prodname_codeql %} build modes
@@ -118,6 +124,41 @@ steps:
118
124
119
125
For information about the languages, libraries, and frameworks that are supported in the latest version of {% data variables.product.prodname_codeql %}, see "[Supported languages and frameworks](https://codeql.github.com/docs/codeql-overview/supported-languages-and-frameworks)" in the {% data variables.product.prodname_codeql %} documentation. For information about the system requirements for running the latest version of {% data variables.product.prodname_codeql %}, see "[System requirements](https://codeql.github.com/docs/codeql-overview/system-requirements/#additional-software-requirements)" in the {% data variables.product.prodname_codeql %} documentation.
120
126
127
+
{% ifversion codeql-dependency-caching %}
128
+
129
+
## About dependency caching for {% data variables.product.prodname_codeql %}
130
+
131
+
You can use dependency caching with {% data variables.product.prodname_codeql %} to store dependencies as a {% data variables.product.prodname_actions %} cache instead of downloading them from registries. This reduces the risk of losing alerts when third party registries don't work well, and may result in a performance improvement for projects that have a large number of dependencies or work with slow registries. To read more about how caching dependencies can speed up workflows, see "[AUTOTITLE](/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows)."
132
+
133
+
Dependency caching works with all build modes, and is supported by {% data variables.code-scanning.codeql_dependency_caching_languages %}.
134
+
135
+
>[!NOTE]
136
+
> Using dependency caching will store {% data variables.product.prodname_codeql %}-specific caches that will be subject to cache quotas for a repository. See "[AUTOTITLE](/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy)."
137
+
138
+
### Enabling dependency caching for {% data variables.product.prodname_codeql %}
139
+
140
+
For default setup workflows, dependency caching is enabled by default for {% data variables.product.github %}-hosted runners in public repositories.
141
+
142
+
For advanced setup workflows, dependency caching is disabled by default. To enable dependency caching for {% data variables.product.prodname_codeql %}, use the `dependency-caching` setting for the {% data variables.product.prodname_codeql %} action in your advanced setup workflow. This setting accepts the following values:
143
+
144
+
* `false`/`none`/`off`: Dependency caching is disabled (default)
145
+
* `restore`: Only restore existing caches, do not store new caches
146
+
* `store`: Only store new caches, do not restore existing caches
147
+
* `true`/`full`/`on`: Restore existing caches, and store new caches
148
+
149
+
For example, the following settings would enable dependency caching for the {% data variables.product.prodname_codeql %} action:
150
+
151
+
```yaml
152
+
# Initializes CodeQL with dependency caching enabled
153
+
- name: Initialize CodeQL
154
+
uses: {% data reusables.actions.action-codeql-action-init %}
155
+
with:
156
+
languages: java
157
+
dependency-caching: true
158
+
```
159
+
160
+
{% endif %}
161
+
121
162
{% ifversion codeql-no-build %}
122
163
123
164
## About build mode None for {% data variables.product.prodname_codeql %}
0 commit comments