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

Add upgrading NPM to all workflows running older Node.js versions #545

Merged
merged 1 commit into from
Jul 12, 2023
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
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
nhtruong marked this conversation as resolved.
Show resolved Hide resolved

- name: Install
run: |
npm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
make cluster.clean cluster.opensearch.build cluster.opensearch.start

- name: Use Node.js 16.x
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16.x

Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,21 @@ jobs:
- uses: actions/checkout@v2

- 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
nhtruong marked this conversation as resolved.
Show resolved Hide resolved

- 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
13 changes: 12 additions & 1 deletion .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,21 @@ jobs:
- uses: actions/checkout@v2

- 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
15 changes: 13 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,28 @@ 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]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2

- 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 @@ -153,4 +154,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
Loading