Skip to content

Commit

Permalink
Add upgrading NPM to all workflows running older Node.js versions (op…
Browse files Browse the repository at this point in the history
…ensearch-project#545)

Also:
* Add compatibility checks for Node.js v18
* Bump `actions/setup-node` to v3

Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Jul 12, 2023
1 parent 8e5547e commit 3e07ab4
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/bundler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,21 @@ jobs:
make cluster.clean cluster.opensearch.build cluster.opensearch.start
- name: Use Node.js 14.x
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x

# NPM started understanding yarn.lock file starting from v7
- name: Update NPM
shell: bash
run: |
export NPM_VERSION=$(npm -v)
export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7")
if [ "$IS_NPM_SUITABLE" == "false" ]; then
echo "NPM needs upgrading!"
npm i npm@7 -g
fi
- name: Install
run: |
npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Update gh-pages with docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
ruby-version: 16.x
- name: Install Tools
Expand Down
30 changes: 26 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -34,10 +34,21 @@ jobs:
make cluster.clean cluster.opensearch.build cluster.opensearch.start
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# NPM started understanding yarn.lock file starting from v7
- name: Update NPM
shell: bash
run: |
export NPM_VERSION=$(npm -v)
export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7")
if [ "$IS_NPM_SUITABLE" == "false" ]; then
echo "NPM needs upgrading!"
npm i npm@7 -g
fi
- name: Install
run: |
npm install
Expand All @@ -52,7 +63,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 16.x]
node-version: [10.x, 12.x, 14.x, 16.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -70,10 +81,21 @@ jobs:
make cluster.clean cluster.opensearch.build cluster.opensearch.start
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

# NPM started understanding yarn.lock file starting from v7
- name: Update NPM
shell: bash
run: |
export NPM_VERSION=$(npm -v)
export IS_NPM_SUITABLE=$(node -p "parseInt(process.env.NPM_ROOT, 10) >= 7")
if [ "$IS_NPM_SUITABLE" == "false" ]; then
echo "NPM needs upgrading!"
npm i npm@7 -g
fi
- name: Install
run: |
npm install
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Bumps `node-fetch` from 3.2.10 to 3.3.1
### Changed
- Implemented Docker Image caching for `integration-unreleased` workflow ([#387](https://github.com/opensearch-project/opensearch-js/issues/387))
- Add upgrading NPM to all workflows running older Node.js versions ([#545](https://github.com/opensearch-project/opensearch-js/issues/545))
### Deprecated
### Removed
### Fixed
Expand Down Expand Up @@ -151,4 +152,4 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
[2.1.0]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.1.0
[2.2.0]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.2.0
[2.2.1]: https://github.com/opensearch-project/opensearch-js/releases/tag/2.2.1
[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.2.1...HEAD
[Unreleased]: https://github.com/opensearch-project/opensearch-js/compare/2.2.1...HEAD

0 comments on commit 3e07ab4

Please sign in to comment.