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/actions/guides/building-and-testing-java-with-ant.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ To get started quickly, you can choose the preconfigured Ant template when you c
38
38
You can also add this workflow manually by creating a new file in the `.github/workflows` directory of your repository.
39
39
40
40
{% raw %}
41
-
```yaml
41
+
```yaml{:copy}
42
42
name: Java CI
43
43
44
44
on: [push]
@@ -79,7 +79,7 @@ The starter workflow will run the default target specified in your _build.xml_ f
79
79
If you use different commands to build your project, or you want to run a different target, you can specify those. For example, you may want to run the `jar` target that's configured in your _build-ci.xml_ file.
80
80
81
81
{% raw %}
82
-
```yaml
82
+
```yaml{:copy}
83
83
steps:
84
84
- uses: actions/checkout@v2
85
85
- uses: actions/setup-java@v1
@@ -97,7 +97,7 @@ After your build has succeeded and your tests have passed, you may want to uploa
97
97
Ant will usually create output files like JARs, EARs, or WARs in the `build/jar` directory. You can upload the contents of that directory using the `upload-artifact` action.
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-java-with-gradle.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ To get started quickly, you can choose the preconfigured Gradle template when yo
38
38
You can also add this workflow manually by creating a new file in the `.github/workflows` directory of your repository.
39
39
40
40
{% raw %}
41
-
```yaml
41
+
```yaml{:copy}
42
42
name: Java CI
43
43
44
44
on: [push]
@@ -79,7 +79,7 @@ The starter workflow will run the `build` task by default. In the default Gradle
79
79
If you use different commands to build your project, or you want to use a different task, you can specify those. For example, you may want to run the `package` task that's configured in your _ci.gradle_ file.
80
80
81
81
{% raw %}
82
-
```yaml
82
+
```yaml{:copy}
83
83
steps:
84
84
- uses: actions/checkout@v2
85
85
- uses: actions/setup-java@v1
@@ -95,7 +95,7 @@ steps:
95
95
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache your dependencies to speed up your workflow runs. After a successful run, your local Gradle package cache will be stored on GitHub Actions infrastructure. In future workflow runs, the cache will be restored so that dependencies don't need to be downloaded from remote package repositories. For more information, see "<ahref="/actions/guides/caching-dependencies-to-speed-up-workflows"class="dotcom-only">Caching dependencies to speed up workflows</a>" and the [`cache` action](https://github.com/marketplace/actions/cache).
96
96
97
97
{% raw %}
98
-
```yaml
98
+
```yaml{:copy}
99
99
steps:
100
100
- uses: actions/checkout@v2
101
101
- name: Set up JDK 1.8
@@ -122,7 +122,7 @@ After your build has succeeded and your tests have passed, you may want to uploa
122
122
Gradle will usually create output files like JARs, EARs, or WARs in the `build/libs` directory. You can upload the contents of that directory using the `upload-artifact` action.
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-java-with-maven.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ To get started quickly, you can choose the preconfigured Maven template when you
38
38
You can also add this workflow manually by creating a new file in the `.github/workflows` directory of your repository.
39
39
40
40
{% raw %}
41
-
```yaml
41
+
```yaml{:copy}
42
42
name: Java CI
43
43
44
44
on: [push]
@@ -79,7 +79,7 @@ The starter workflow will run the `package` target by default. In the default Ma
79
79
If you use different commands to build your project, or you want to use a different target, you can specify those. For example, you may want to run the `verify` target that's configured in a _pom-ci.xml_ file.
80
80
81
81
{% raw %}
82
-
```yaml
82
+
```yaml{:copy}
83
83
steps:
84
84
- uses: actions/checkout@v2
85
85
- uses: actions/setup-java@v1
@@ -95,7 +95,7 @@ steps:
95
95
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can cache your dependencies to speed up your workflow runs. After a successful run, your local Maven repository will be stored on GitHub Actions infrastructure. In future workflow runs, the cache will be restored so that dependencies don't need to be downloaded from remote Maven repositories. For more information, see "<ahref="/actions/guides/caching-dependencies-to-speed-up-workflows"class="dotcom-only">Caching dependencies to speed up workflows</a>" and the [`cache` action](https://github.com/marketplace/actions/cache).
96
96
97
97
{% raw %}
98
-
```yaml
98
+
```yaml{:copy}
99
99
steps:
100
100
- uses: actions/checkout@v2
101
101
- name: Set up JDK 1.8
@@ -122,7 +122,7 @@ After your build has succeeded and your tests have passed, you may want to uploa
122
122
Maven will usually create output files like JARs, EARs, or WARs in the `target` directory. To upload those as artifacts, you can copy them into a new directory that contains artifacts to upload. For example, you can create a directory called `staging`. Then you can upload the contents of that directory using the `upload-artifact` action.
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-nodejs.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ The template includes a matrix strategy that builds and tests your code with fou
77
77
Each job can access the value defined in the matrix `node-version` array using the `matrix` context. The `setup-node` action uses the context as the `node-version` input. The `setup-node` action configures each job with a different Node.js version before building and testing code. For more information about matrix strategies and contexts, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)" and "[Context and expression syntax for {% data variables.product.prodname_actions %}](/actions/reference/context-and-expression-syntax-for-github-actions)."
78
78
79
79
{% raw %}
80
-
```yaml
80
+
```yaml{:copy}
81
81
strategy:
82
82
matrix:
83
83
node-version: [10.x, 12.x, 14.x, 15.x]
@@ -93,7 +93,7 @@ steps:
93
93
94
94
Alternatively, you can build and test with exact Node.js versions.
95
95
96
-
```yaml
96
+
```yaml{:copy}
97
97
strategy:
98
98
matrix:
99
99
node-version: [8.16.2, 10.17.0]
@@ -102,7 +102,7 @@ strategy:
102
102
Or, you can build and test using a single version of Node.js too.
103
103
104
104
{% raw %}
105
-
```yaml
105
+
```yaml{:copy}
106
106
name: Node.js CI
107
107
108
108
on: [push]
@@ -136,7 +136,7 @@ When using {% data variables.product.prodname_dotcom %}-hosted runners, you can
136
136
137
137
This example installs the dependencies defined in the *package.json* file. For more information, see [`npm install`](https://docs.npmjs.com/cli/install).
138
138
139
-
```yaml
139
+
```yaml{:copy}
140
140
steps:
141
141
- uses: actions/checkout@v2
142
142
- name: Use Node.js
@@ -150,7 +150,7 @@ steps:
150
150
Using `npm ci` installs the versions in the *package-lock.json* or *npm-shrinkwrap.json* file and prevents updates to the lock file. Using `npm ci` is generally faster than running `npm install`. For more information, see [`npm ci`](https://docs.npmjs.com/cli/ci.html) and "[Introducing `npm ci` for faster, more reliable builds](https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable)."
151
151
152
152
{% raw %}
153
-
```yaml
153
+
```yaml{:copy}
154
154
steps:
155
155
- uses: actions/checkout@v2
156
156
- name: Use Node.js
@@ -166,7 +166,7 @@ steps:
166
166
167
167
This example installs the dependencies defined in the *package.json* file. For more information, see [`yarn install`](https://yarnpkg.com/en/docs/cli/install).
168
168
169
-
```yaml
169
+
```yaml{:copy}
170
170
steps:
171
171
- uses: actions/checkout@v2
172
172
- name: Use Node.js
@@ -179,7 +179,7 @@ steps:
179
179
180
180
Alternatively, you can pass `--frozen-lockfile` to install the versions in the *yarn.lock* file and prevent updates to the *yarn.lock* file.
181
181
182
-
```yaml
182
+
```yaml{:copy}
183
183
steps:
184
184
- uses: actions/checkout@v2
185
185
- name: Use Node.js
@@ -201,7 +201,7 @@ In the example below, the secret `NPM_TOKEN` stores the npm authentication token
201
201
Before installing dependencies, use the `setup-node` action to create the *.npmrc* file. The action has two input parameters. The `node-version` parameter sets the Node.js version, and the `registry-url` parameter sets the default registry. If your package registry uses scopes, you must use the `scope` parameter. For more information, see [`npm-scope`](https://docs.npmjs.com/misc/scope).
202
202
203
203
{% raw %}
204
-
```yaml
204
+
```yaml{:copy}
205
205
steps:
206
206
- uses: actions/checkout@v2
207
207
- name: Use Node.js
@@ -231,7 +231,7 @@ always-auth=true
231
231
When using {% data variables.product.prodname_dotcom %}-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 "<ahref="/actions/guides/caching-dependencies-to-speed-up-workflows"class="dotcom-only">Caching dependencies to speed up workflows</a>" and the [`cache` action](https://github.com/marketplace/actions/cache).
232
232
233
233
{% raw %}
234
-
```yaml
234
+
```yaml{:copy}
235
235
steps:
236
236
- uses: actions/checkout@v2
237
237
- name: Use Node.js
@@ -256,7 +256,7 @@ steps:
256
256
257
257
You can use the same commands that you use locally to build and test your code. For example, if you run `npm run build` to run build steps defined in your *package.json* file and `npm test` to run your test suite, you would add those commands in your workflow file.
Copy file name to clipboardExpand all lines: content/actions/guides/building-and-testing-python.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ We recommend that you have a basic understanding of Python, PyPy, and pip. For m
37
37
To get started quickly, add the template to the `.github/workflows` directory of your repository.
38
38
39
39
{% raw %}
40
-
```yaml
40
+
```yaml{:copy}
41
41
name: Python package
42
42
43
43
on: [push]
@@ -94,7 +94,7 @@ If you are using a self-hosted runner, you can configure the runner to use the `
94
94
#### Using multiple Python versions
95
95
96
96
{% raw %}
97
-
```yaml
97
+
```yaml{:copy}
98
98
name: Python package
99
99
100
100
on: [push]
@@ -126,7 +126,7 @@ jobs:
126
126
You can configure a specific version of python. For example, 3.8. Alternatively, you can use semantic version syntax to get the latest minor release. This example uses the latest minor release of Python 3.
127
127
128
128
{% raw %}
129
-
```yaml
129
+
```yaml{:copy}
130
130
name: Python package
131
131
132
132
on: [push]
@@ -158,7 +158,7 @@ If you specify a version of Python that is not available, `setup-python` fails w
158
158
You can also use the `exclude` keyword in your workflow if there is a configuration of Python that you do not wish to run. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy)."
159
159
160
160
{% raw %}
161
-
```yaml
161
+
```yaml{:copy}
162
162
name: Python package
163
163
164
164
on: [push]
@@ -196,7 +196,7 @@ We recommend using `setup-python` to configure the version of Python used in you
196
196
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can also cache dependencies to speed up your workflow. For more information, see "<ahref="/actions/guides/caching-dependencies-to-speed-up-workflows"class="dotcom-only">Caching dependencies to speed up workflows</a>."
197
197
198
198
{% raw %}
199
-
```yaml
199
+
```yaml{:copy}
200
200
steps:
201
201
- uses: actions/checkout@v2
202
202
- name: Set up Python
@@ -213,7 +213,7 @@ steps:
213
213
After you update `pip`, a typical next step is to install dependencies from *requirements.txt*.
214
214
215
215
{% raw %}
216
-
```yaml
216
+
```yaml{:copy}
217
217
steps:
218
218
- uses: actions/checkout@v2
219
219
- name: Set up Python
@@ -234,7 +234,7 @@ When using {% data variables.product.prodname_dotcom %}-hosted runners, you can
234
234
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).
235
235
236
236
{% raw %}
237
-
```yaml
237
+
```yaml{:copy}
238
238
steps:
239
239
- uses: actions/checkout@v2
240
240
- name: Setup Python
@@ -271,7 +271,7 @@ You can use the same commands that you use locally to build and test your code.
271
271
This example installs or upgrades `pytest` and `pytest-cov`. Tests are then run and output in JUnit format while code coverage results are output in Cobertura. For more information, see [JUnit](https://junit.org/junit5/) and [Cobertura](https://cobertura.github.io/cobertura/).
272
272
273
273
{% raw %}
274
-
```yaml
274
+
```yaml{:copy}
275
275
steps:
276
276
- uses: actions/checkout@v2
277
277
- name: Set up Python
@@ -295,7 +295,7 @@ steps:
295
295
The following example installs or upgrades `flake8` and uses it to lint all files. For more information, see [Flake8](http://flake8.pycqa.org/en/latest/).
296
296
297
297
{% raw %}
298
-
```yaml
298
+
```yaml{:copy}
299
299
steps:
300
300
- uses: actions/checkout@v2
301
301
- name: Set up Python
@@ -318,7 +318,7 @@ steps:
318
318
With {% data variables.product.prodname_actions %}, you can run tests with tox and spread the work across multiple jobs. You'll need to invoke tox using the `-e py` option to choose the version of Python in your `PATH`, rather than specifying a specific version. For more information, see [tox](https://tox.readthedocs.io/en/latest/).
319
319
320
320
{% raw %}
321
-
```yaml
321
+
```yaml{:copy}
322
322
name: Python package
323
323
324
324
on: [push]
@@ -352,7 +352,7 @@ You can upload artifacts to view after a workflow completes. For example, you ma
352
352
The following example demonstrates how you can use the `upload-artifact` action to archive test results from running `pytest`. For more information, see the [`upload-artifact` action](https://github.com/actions/upload-artifact).
353
353
354
354
{% raw %}
355
-
```yaml
355
+
```yaml{:copy}
356
356
name: Python package
357
357
358
358
on: [push]
@@ -395,7 +395,7 @@ You can configure your workflow to publish your Python package to any package re
395
395
You can store any access tokens or credentials needed to publish your package using secrets. The following example creates and publishes a package to PyPI using `twine` and `dist`. For more information, see "[Creating and using encrypted secrets](/github/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
Copy file name to clipboardExpand all lines: content/actions/guides/caching-dependencies-to-speed-up-workflows.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ For more information, see [`actions/cache`](https://github.com/actions/cache).
68
68
This example creates a new cache when the packages in `package-lock.json` file change, or when the runner's operating system changes. The cache key uses contexts and expressions to generate a key that includes the runner's operating system and a SHA-256 hash of the `package-lock.json` file.
Copy file name to clipboardExpand all lines: content/actions/guides/creating-postgresql-service-containers.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ You may also find it helpful to have a basic understanding of YAML, the syntax f
37
37
{% data reusables.github-actions.copy-workflow-file %}
38
38
39
39
{% raw %}
40
-
```yaml
40
+
```yaml{:copy}
41
41
name: PostgreSQL service example
42
42
on: push
43
43
@@ -94,7 +94,7 @@ jobs:
94
94
95
95
{% data reusables.github-actions.postgres-label-description %}
96
96
97
-
```yaml
97
+
```yaml{:copy}
98
98
jobs:
99
99
# Label of the container job
100
100
container-job:
@@ -124,7 +124,7 @@ jobs:
124
124
125
125
{% data reusables.github-actions.service-template-steps %}
126
126
127
-
```yaml
127
+
```yaml{:copy}
128
128
steps:
129
129
# Downloads a copy of the code in your repository before running CI tests
130
130
- name: Check out repository code
@@ -159,7 +159,7 @@ When you run a job directly on the runner machine, you'll need to map the ports
159
159
{% data reusables.github-actions.copy-workflow-file %}
160
160
161
161
{% raw %}
162
-
```yaml
162
+
```yaml{:copy}
163
163
name: PostgreSQL Service Example
164
164
on: push
165
165
@@ -220,7 +220,7 @@ jobs:
220
220
221
221
The workflow maps port 5432 on the PostgreSQL service container to the Docker host. For more information about the `ports` keyword, see "[About service containers](/actions/automating-your-workflow-with-github-actions/about-service-containers#mapping-docker-host-and-service-container-ports)."
222
222
223
-
```yaml
223
+
```yaml{:copy}
224
224
jobs:
225
225
# Label of the runner job
226
226
runner-job:
@@ -251,7 +251,7 @@ jobs:
251
251
252
252
{% data reusables.github-actions.service-template-steps %}
253
253
254
-
```yaml
254
+
```yaml{:copy}
255
255
steps:
256
256
# Downloads a copy of the code in your repository before running CI tests
257
257
- name: Check out repository code
@@ -287,7 +287,7 @@ You can modify *client.js* to include any PostgreSQL operations needed by your w
287
287
288
288
{% data reusables.github-actions.service-container-add-script %}
0 commit comments