Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Node.js v20 for the GitHub Actions Library [MABL-13559] #21

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/push-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ jobs:
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
- ubuntu-latest
- macos-latest
- windows-2019
- windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
# Use the minimum supported mabl-cli Node.js LTS version here
node-version: '14.x'
node-version-file: '.nvmrc'

- name: Install dependencies
run: npm ci
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GitHub action to configure the
installs and configures the CLI with a mabl API key, if one is provided. Note
that API keys should be stored as [GitHub secrets](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization).

This action requires Node.js 12+ be installed as part of your workflow.
This action requires Node.js 18+ be installed as part of your workflow.
The [mabl-cli](https://www.npmjs.com/package/@mablhq/mabl-cli) will be installed into that Node.js runtime.
See below for an example of how to install Node.js.

Expand All @@ -27,8 +27,8 @@ See below for an example of how to install Node.js.

## Requirements

- Requires Node.js 12+ be installed as a prior step. This is most easily done with
the `actions/setup-node@v2` action.
- Requires Node.js 18+ be installed as a prior step. This is most easily done with
the `actions/setup-node@v4` action.

## Examples

Expand All @@ -46,9 +46,9 @@ jobs:
name: Mabl Tests
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '18.x'

- uses: mablhq/setup-mabl-cli@v1
with:
Expand All @@ -60,7 +60,7 @@ jobs:
run: mabl test-runs export ar5vXBJ-rpan1nSs445s3A-jr -f screenshots.zip

- name: Upload screenshots
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: screenshots
path: screenshots.zip
Expand All @@ -83,9 +83,9 @@ jobs:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '18.x'

- uses: mablhq/setup-mabl-cli@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ inputs:
description: (optional) The id of the workspace to configure as default for the CLI
required: false
runs:
using: "node16"
using: "node20"
main: "lib/index.js"
126 changes: 85 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-mabl-cli",
"version": "1.4.0",
"version": "1.4.1",
"description": "mabl GitHub action to setup mabl CLI",
"main": "lib/index.js",
"scripts": {
Expand All @@ -10,14 +10,14 @@
},
"author": "mablhq",
"dependencies": {
"@actions/core": "1.10.0",
"@actions/core": "1.10.1",
"@actions/exec": "1.1.1",
"@actions/tool-cache": "2.0.1"
},
"devDependencies": {
"@types/es6-promise": "3.3.0",
"@types/mocha": "10.0.0",
"@types/node": "16.11.68",
"@types/node": "20.12.12",
"@types/q": "1.5.5",
"typescript": "4.8.4"
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as toolCache from '@actions/tool-cache';

type Option<T> = T | undefined;

const REQUIRED_NODEJS_MAJOR_VERSION = 14;
const REQUIRED_NODEJS_MAJOR_VERSION = 18;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be 20? Or we're saying that the min is 18, but it's compatible with up to 20?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20 is what the GH Actions JS runs under, inside GH.
18 is what the CLI code runs under, on the system where the CLI will be installed.

These are disparate runtimes, @jbaldassari


async function run(): Promise<void> {
const version: Option<string> = core.getInput('version', {required: false});
Expand Down
Loading