Skip to content

Commit 7053070

Browse files
authored
Merge pull request #12290 from github/repo-sync
repo sync
2 parents 94f7eac + b01c190 commit 7053070

10 files changed

Lines changed: 57 additions & 61 deletions

File tree

-12.4 KB
Loading

components/landing/LandingSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Props = {
99
}
1010
export const LandingSection = ({ title, children, className, sectionLink, description }: Props) => {
1111
return (
12-
<div className={cx('container-xl px-3 px-md-6', className)} id={sectionLink}>
12+
<div className={cx('container-xl px-3 px-md-6 mt-6', className)} id={sectionLink}>
1313
{title && (
1414
<h2 className={cx('h1 color-fg-default', !description ? 'mb-3' : 'mb-4')}>
1515
{sectionLink ? (

components/playground/content/building-and-testing/nodejs.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ const article: PlaygroundArticleT = {
180180
type: 'sub-section',
181181
title: 'Example caching dependencies',
182182
content: dedent`
183-
When using GitHub-hosted runners, you can cache dependencies using a unique key, and restore the dependencies when you run future workflows using the \`cache\` action. For more information, see [Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows) and the [\`cache\` action](https://github.com/marketplace/actions/cache).
183+
184+
When using GitHub-hosted runners, you can cache and restore the dependencies using the [\`setup-node\` action](https://github.com/actions/setup-node). To cache dependencies with the \`setup-node\` action, you must have a \`package-lock.json\`, \`yarn.lock\`, or \`pnpm-lock.yaml\` file in the root of the repository.
185+
186+
If you have a custom requirement or need finer controls for caching, you can use the [\`cache\` action](https://github.com/marketplace/actions/cache). For more information, see [Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows) and the [\`cache\` action](https://github.com/marketplace/actions/cache).
187+
184188
`,
185189
},
186190
{
@@ -493,15 +497,7 @@ const article: PlaygroundArticleT = {
493497
uses: actions/setup-node@v1
494498
with:
495499
node-version: '12.x'
496-
- name: Cache Node.js modules
497-
uses: actions/cache@v2
498-
with:
499-
# npm cache files are stored in \`~/.npm\` on Linux/macOS
500-
path: ~/.npm
501-
key: \${{ runner.OS }}-node-\${{ hashFiles('**/package-lock.json') }}
502-
restore-keys: |
503-
\${{ runner.OS }}-node-
504-
\${{ runner.OS }}-
500+
cache: 'npm'
505501
- name: Install dependencies
506502
run: npm ci
507503
`,

components/playground/content/building-and-testing/python.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ const article: PlaygroundArticleT = {
136136
},
137137
title: 'Caching Dependencies',
138138
content: dedent`
139-
When using GitHub-hosted runners, you can cache pip dependencies using a unique key, and restore the dependencies when you run future workflows using the [\`cache\`](https://github.com/marketplace/actions/cache) action. For more information, see "[Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows)."
140139
141-
Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example shown depending on the operating system you use. For more information, see [Python caching examples](https://github.com/actions/cache/blob/main/examples.md#python---pip).
140+
When using GitHub-hosted runners, you can cache and restore the dependencies using the [\`setup-python\` action](https://github.com/actions/setup-python). By default, the \`setup-python\` action searches for the dependency file (\`requirements.txt\` for pip or \`Pipfile.lock\` for pipenv) in the whole repository.
141+
142+
If you have a custom requirement or need finer controls for caching, you can use the [\`cache\` action](https://github.com/marketplace/actions/cache). Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example shown here, depending on the operating system you use. For more information, see [Caching dependencies to speed up workflows](/actions/guides/caching-dependencies-to-speed-up-workflows) and the [\`cache\` action](https://github.com/marketplace/actions/cache).
142143
143-
**Note:** Depending on the number of dependencies, it may be faster to use the dependency cache. Projects with many large dependencies should see a performance increase as it cuts down the time required for downloading. Projects with fewer dependencies may not see a significant performance increase and may even see a slight decrease due to how pip installs cached dependencies. The performance varies from project to project.
144144
`,
145145
},
146146
{
@@ -392,16 +392,7 @@ const article: PlaygroundArticleT = {
392392
uses: actions/setup-python@v2
393393
with:
394394
python-version: '3.x'
395-
- name: Cache pip
396-
uses: actions/cache@v2
397-
with:
398-
# This path is specific to Ubuntu
399-
path: ~/.cache/pip
400-
# Look to see if there is a cache hit for the corresponding requirements file
401-
key: \${{ runner.os }}-pip-\${{ hashFiles('requirements.txt') }}
402-
restore-keys: |
403-
\${{ runner.os }}-pip-
404-
\${{ runner.os }}-
395+
cache: 'pip'
405396
- name: Install dependencies
406397
run: pip install -r requirements.txt
407398
`,

content/actions/advanced-guides/caching-dependencies-to-speed-up-workflows.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,34 @@ Jobs on {% data variables.product.prodname_dotcom %}-hosted runners start in a c
2323

2424
To cache dependencies for a job, you'll need to use {% data variables.product.prodname_dotcom %}'s `cache` action. The action retrieves a cache identified by a unique key. For more information, see [`actions/cache`](https://github.com/actions/cache).
2525

26-
If you are caching Ruby gems, instead consider using the Ruby maintained action, which can cache bundle installs on initiation. For more information, see [`ruby/setup-ruby`](https://github.com/ruby/setup-ruby#caching-bundle-install-automatically).
27-
28-
To cache and restore dependencies for npm, Yarn, or pnpm, you can use the [`actions/setup-node` action](https://github.com/actions/setup-node).
29-
30-
Gradle and Maven caching is available with [`actions/setup-java` action](https://github.com/actions/setup-java).
26+
If you are caching the package managers listed below, consider using the respective setup-* actions, which require almost zero configuration and are easy to use.
27+
28+
<table>
29+
<thead>
30+
<tr>
31+
<th>Package managers</th>
32+
<th>setup-* action for caching</th>
33+
</tr>
34+
</thead>
35+
<tbody>
36+
<tr>
37+
<td>npm, yarn, pnpm</td>
38+
<td><a href="https://github.com/actions/setup-node">setup-node</a></td>
39+
</tr>
40+
<tr>
41+
<td>pip, pipenv</td>
42+
<td><a href="https://github.com/actions/setup-python">setup-python</a></td>
43+
</tr>
44+
<tr>
45+
<td>gradle, maven</td>
46+
<td><a href="https://github.com/actions/setup-java">setup-java</a></td>
47+
</tr>
48+
<tr>
49+
<td>ruby gems</td>
50+
<td><a href="https://github.com/ruby/setup-ruby">setup-ruby</a></td>
51+
</tr>
52+
</tbody>
53+
</table>
3154

3255
{% warning %}
3356

content/actions/automating-builds-and-tests/building-and-testing-nodejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ steps:
288288
- run: pnpm test
289289
```
290290

291-
To cache dependencies, you must have a `package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml` file in the root of the repository. If you need more flexible customization, you can use the [`cache` action](https://github.com/marketplace/actions/cache). For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>".
291+
If you have a custom requirement or need finer controls for caching, you can use the [`cache` action](https://github.com/marketplace/actions/cache). For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>".
292292

293293
## Building and testing your code
294294

content/actions/automating-builds-and-tests/building-and-testing-python.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -241,38 +241,24 @@ steps:
241241

242242
### Caching Dependencies
243243

244-
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache pip dependencies using a unique key, and restore the dependencies when you run future workflows using the [`cache`](https://github.com/marketplace/actions/cache) action. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
244+
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache and restore the dependencies using the [`setup-python` action](https://github.com/actions/setup-python).
245245

246-
Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example below depending on the operating system you use. For more information, see [Python caching examples](https://github.com/actions/cache/blob/main/examples.md#python---pip).
246+
The following example caches dependencies for pip.
247247

248-
{% raw %}
249248
```yaml{:copy}
250249
steps:
251250
- uses: actions/checkout@v2
252-
- name: Setup Python
253-
uses: actions/setup-python@v2
254-
with:
255-
python-version: '3.x'
256-
- name: Cache pip
257-
uses: actions/cache@v2
251+
- uses: actions/setup-python@v2
258252
with:
259-
# This path is specific to Ubuntu
260-
path: ~/.cache/pip
261-
# Look to see if there is a cache hit for the corresponding requirements file
262-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
263-
restore-keys: |
264-
${{ runner.os }}-pip-
265-
${{ runner.os }}-
266-
- name: Install dependencies
267-
run: pip install -r requirements.txt
253+
python-version: '3.9'
254+
cache: 'pip'
255+
- run: pip install -r requirements.txt
256+
- run: pip test
268257
```
269-
{% endraw %}
270-
271-
{% note %}
272258

273-
**Note:** Depending on the number of dependencies, it may be faster to use the dependency cache. Projects with many large dependencies should see a performance increase as it cuts down the time required for downloading. Projects with fewer dependencies may not see a significant performance increase and may even see a slight decrease due to how pip installs cached dependencies. The performance varies from project to project.
259+
By default, the `setup-python` action searches for the dependency file (`requirements.txt` for pip or `Pipfile.lock` for pipenv) in the whole repository. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching packages dependencies</a>" in the `setup-python` actions README.
274260

275-
{% endnote %}
261+
If you have a custom requirement or need finer controls for caching, you can use the [`cache` action](https://github.com/marketplace/actions/cache). Pip caches dependencies in different locations, depending on the operating system of the runner. The path you'll need to cache may differ from the Ubuntu example above, depending on the operating system you use. For more information, see [Python caching examples](https://github.com/actions/cache/blob/main/examples.md#python---pip) in the `cache` action repository.
276262

277263
## Testing your code
278264

content/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ To configure whether workflows in an internal repository can be accessed from ou
128128
1. Under **Access**, choose one of the access settings:
129129
![Set the access to Actions components](/assets/images/help/settings/actions-access-settings.png)
130130
* **Not accessible** - Workflows in other repositories can't use workflows in this repository.
131-
* **Repositories in the &lt;organization name&gt; organization can access** - Workflows in other repositories can use workflows in this repository if they belong to the same organization and their visibility is private or internal.
132-
* **Repositories in any organization belong to the &lt;enterprise name&gt; enterprise can access** - Workflows in other repositories can use workflows in this repository if they belong to the same enterprise and their visibility is private or internal.
131+
* **Accessible from repositories in the '&lt;organization name&gt;' organization** - Workflows in other repositories can use workflows in this repository if they are part of the same organization and their visibility is private or internal.
132+
* **Accessible from repositories in the '&lt;enterprise name&gt;' enterprise** - Workflows in other repositories can use workflows in this repository if they are part of the same enterprise and their visibility is private or internal.
133133
1. Click **Save** to apply the settings.
134134
{% endif %}
135135

package-lock.json

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

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
".next/cache"
1010
],
1111
"dependencies": {
12-
"@alex_neo/jest-expect-message": "^1.0.5",
1312
"@github/failbot": "0.7.0",
1413
"@hapi/accept": "^5.0.2",
1514
"@primer/components": "^31.1.0",
@@ -67,7 +66,6 @@
6766
"rate-limit-redis": "^2.1.0",
6867
"react": "^17.0.2",
6968
"react-dom": "^17.0.2",
70-
"react-is": "^17.0.2",
7169
"react-markdown": "^7.1.0",
7270
"react-syntax-highlighter": "^15.4.4",
7371
"redis": "^3.1.2",
@@ -100,6 +98,7 @@
10098
"devDependencies": {
10199
"@actions/core": "^1.6.0",
102100
"@actions/github": "^5.0.0",
101+
"@alex_neo/jest-expect-message": "^1.0.5",
103102
"@babel/core": "^7.16.0",
104103
"@babel/eslint-parser": "^7.16.3",
105104
"@babel/plugin-syntax-top-level-await": "^7.14.5",

0 commit comments

Comments
 (0)