diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index e700331..fd0d404 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [10, 12, 14] + node-version: [12, 14, 16] steps: - uses: actions/checkout@v2 - name: Clean global cache @@ -42,7 +42,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [10, 12, 14] + node-version: [12, 14, 16] steps: - uses: actions/checkout@v2 - name: Yarn version @@ -72,7 +72,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [10, 12, 14] + node-version: [12, 14, 16] steps: - uses: actions/checkout@v2 - name: Update yarn diff --git a/.github/workflows/proxy.yml b/.github/workflows/proxy.yml index 6eaa157..04e9179 100644 --- a/.github/workflows/proxy.yml +++ b/.github/workflows/proxy.yml @@ -30,12 +30,12 @@ jobs: - uses: actions/checkout@v2 - name: Clear tool cache run: rm -rf $RUNNER_TOOL_CACHE/* - - name: Setup node 10 + - name: Setup node 14 uses: ./ with: - node-version: 10.x + node-version: 14.x - name: Verify node and npm - run: __tests__/verify-node.sh 10 + run: __tests__/verify-node.sh 14 test-bypass-proxy: runs-on: ubuntu-latest diff --git a/.github/workflows/versions.yml b/.github/workflows/versions.yml index b06471b..cb2b210 100644 --- a/.github/workflows/versions.yml +++ b/.github/workflows/versions.yml @@ -49,7 +49,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [10.15, 12.16.0, 14.2.0] + node-version: [10.15, 12.16.0, 14.2.0, 16.3.0] steps: - uses: actions/checkout@v2 - name: Setup Node @@ -66,7 +66,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - node-version: [10, 11, 12, 14] + node-version: [10, 12, 14] steps: - uses: actions/checkout@v2 - name: Setup Node and check latest @@ -116,10 +116,10 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 - - name: Setup node 12 x86 from dist + - name: Setup node 14 x86 from dist uses: ./ with: - node-version: '12' + node-version: '14' architecture: 'x86' - name: Verify node run: __tests__/verify-arch.sh "ia32" diff --git a/README.md b/README.md index edd3ea6..aa243c2 100644 --- a/README.md +++ b/README.md @@ -26,16 +26,24 @@ steps: - run: npm test ``` -The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, this action will still register problem matchers and support auth features. So setting up the node environment is still a valid scenario without downloading and caching versions. +The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify Node.js version and don't rely on the system one. The action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/). For information regarding locally cached versions of Node.js on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments). +#### Supported version syntax +The `node-version` input supports the following syntax: + +major versions: `12`, `14`, `16` +more specific versions: `10.15`, `14.2.0`, `16.3.0` +nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*` + ### Caching packages dependencies The action has a built-in functionality for caching and restoring npm/yarn dependencies. Supported package managers are `npm`, `yarn`. The `cache` input is optional, and caching is turned off by default. +**Caching npm dependencies:** ```yaml steps: - uses: actions/checkout@v2 @@ -69,7 +77,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [ '12', '14' ] + node: [ '12', '14', '16' ] name: Node ${{ matrix.node }} sample steps: - uses: actions/checkout@v2 diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index c9acacb..6fa7bd4 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -52,9 +52,9 @@ jobs: - macos-latest - windows-latest node_version: - - 10 - 12 - 14 + - 16 architecture: - x64 # an extra windows-x86 run: diff --git a/validate/test.sh b/validate/test.sh deleted file mode 100755 index f066edb..0000000 --- a/validate/test.sh +++ /dev/null @@ -1,22 +0,0 @@ - -#/bin/bash - -set -e - -rm -rf ./temp -rm -rf ./node - -# uncomment to use charles proxy or other debugging proxy -# export NODE_TLS_REJECT_UNAUTHORIZED=0 -# export https_proxy=http://127.0.0.1:8888 - -export RUNNER_TOOL_CACHE=$(pwd) -export RUNNER_TEMP="${RUNNER_TOOL_CACHE}/temp" -export INPUT_STABLE=true -export INPUT_VERSION="12" #"0.12.7" #"12" #"11.15.0" -# export your PAT with repo scope before running -export INPUT_TOKEN=$GITHUB_TOKEN - -echo "Getting ${INPUT_VERSION} ($INPUT_STABLE) with ${INPUT_TOKEN}..." - -node ../dist/index.js