Documentation updates for Node 12 deprecation in GitHub Actions (#41208)
This commit is contained in:
@@ -18,7 +18,7 @@ topics:
|
||||
- CD
|
||||
shortTitle: Migrate from Jenkins
|
||||
---
|
||||
|
||||
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
## Introduction
|
||||
@@ -191,7 +191,7 @@ pipeline {
|
||||
agent { label "${PLATFORM}" }
|
||||
stages {
|
||||
stage('test') {
|
||||
tools { nodejs "node-12" }
|
||||
tools { nodejs "node-16" }
|
||||
steps {
|
||||
dir("scripts/myapp") {
|
||||
sh(script: "npm install -g bats")
|
||||
@@ -223,7 +223,7 @@ jobs:
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 12
|
||||
node-version: 16
|
||||
- run: npm install -g bats
|
||||
- run: bats tests
|
||||
working-directory: scripts/myapp
|
||||
|
||||
@@ -18,7 +18,7 @@ topics:
|
||||
- CD
|
||||
shortTitle: Migrate from Travis CI
|
||||
---
|
||||
|
||||
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
## Introduction
|
||||
@@ -364,7 +364,7 @@ jobs:
|
||||
- name: Use Node.js
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
node-version: '16.x'
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
- run: npm test
|
||||
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node: [12, 14, 16]
|
||||
node: [14, 16]
|
||||
steps:
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
|
||||
@@ -14,7 +14,7 @@ topics:
|
||||
- Networking
|
||||
- Storage
|
||||
shortTitle: Tool cache for offline runners
|
||||
---
|
||||
---
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
## About the included setup actions and the runner tool cache
|
||||
@@ -35,7 +35,7 @@ You can populate the runner tool cache by running a {% data variables.product.pr
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Determine which development environments your self-hosted runners will need. The following example demonstrates how to populate a tool cache for the `setup-node` action, using Node.js versions 10 and 12.
|
||||
- Determine which development environments your self-hosted runners will need. The following example demonstrates how to populate a tool cache for the `setup-node` action, using Node.js versions 14 and 16.
|
||||
- Access to a repository on {% data variables.product.prodname_dotcom_the_website %} that you can use to run a workflow.
|
||||
- Access to your self-hosted runner's file system to populate the tool cache folder.
|
||||
|
||||
@@ -44,10 +44,10 @@ You can populate the runner tool cache by running a {% data variables.product.pr
|
||||
1. On {% data variables.product.prodname_dotcom_the_website %}, navigate to a repository that you can use to run a {% data variables.product.prodname_actions %} workflow.
|
||||
1. Create a new workflow file in the repository's `.github/workflows` folder that uploads an artifact containing the {% data variables.product.prodname_dotcom %}-hosted runner's tool cache.
|
||||
|
||||
The following example demonstrates a workflow that uploads the tool cache for an Ubuntu 22.04 environment, using the `setup-node` action with Node.js versions 10 and 12.
|
||||
The following example demonstrates a workflow that uploads the tool cache for an Ubuntu 22.04 environment, using the `setup-node` action with Node.js versions 14 and 16.
|
||||
|
||||
```yaml
|
||||
name: Upload Node.js 10 and 12 tool cache
|
||||
name: Upload Node.js 14 and 16 tool cache
|
||||
on: push
|
||||
jobs:
|
||||
upload_tool_cache:
|
||||
@@ -57,14 +57,14 @@ You can populate the runner tool cache by running a {% data variables.product.pr
|
||||
run: |
|
||||
mv "{% raw %}${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"{% endraw %}
|
||||
mkdir -p "{% raw %}${{ runner.tool_cache }}{% endraw %}"
|
||||
- name: Setup Node 10
|
||||
- name: Setup Node 14
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 10.x
|
||||
- name: Setup Node 12
|
||||
node-version: 14.x
|
||||
- name: Setup Node 16
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 12.x
|
||||
node-version: 16.x
|
||||
- name: Archive tool cache
|
||||
run: |
|
||||
cd "{% raw %}${{ runner.tool_cache }}{% endraw %}"
|
||||
@@ -87,9 +87,9 @@ You can populate the runner tool cache by running a {% data variables.product.pr
|
||||
├── ...
|
||||
└── _tool
|
||||
└── node
|
||||
├── 10.22.0
|
||||
├── 14.21.3
|
||||
│ └── ...
|
||||
└── 12.18.3
|
||||
└── 16.16.0
|
||||
└── ...
|
||||
```
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node-version: [12.x, 14.x]
|
||||
node-version: [14.x, 16.x]
|
||||
steps:
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
|
||||
@@ -6,7 +6,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
node: [12, 14, 16]
|
||||
node: [14, 16]
|
||||
include:
|
||||
- os: windows-latest
|
||||
node: 16
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
In this example, the matrix entries for `node-version` are each configured to use different values for the `site` and `datacenter` environment variables. The `Echo site details` step then uses {% raw %}`env: ${{ matrix.env }}`{% endraw %} to refer to the custom variables:
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
name: Node.js CI
|
||||
on: [push]
|
||||
@@ -11,18 +9,16 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- node-version: 10.x
|
||||
- node-version: 14.x
|
||||
site: "prod"
|
||||
datacenter: "site-a"
|
||||
- node-version: 12.x
|
||||
- node-version: 16.x
|
||||
site: "dev"
|
||||
datacenter: "site-b"
|
||||
steps:
|
||||
- name: Echo site details
|
||||
env:
|
||||
SITE: ${{ matrix.site }}
|
||||
DATACENTER: ${{ matrix.datacenter }}
|
||||
SITE: {% raw %}${{ matrix.site }}{% endraw %}
|
||||
DATACENTER: {% raw %}${{ matrix.datacenter }}{% endraw %}
|
||||
run: echo $SITE $DATACENTER
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
Reference in New Issue
Block a user