Skip to content

Commit

Permalink
Fix Node.js and Yarn installation in CI (#641)
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <miki@amazon.com>
  • Loading branch information
AMoo-Miki authored Feb 22, 2023
1 parent dbfddf2 commit 092ea63
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 36 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,20 @@ jobs:
repository: opensearch-project/OpenSearch-Dashboards
path: OpenSearch-Dashboards
ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }}
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
- name: Setup node
uses: actions/setup-node@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.node_version }}
node-version-file: './OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install correct yarn version for OpenSearch-Dashboards
- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions.outputs.yarn_version }}
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v
- name: Bootstrap plugin/OpenSearch-Dashboards
run: |
mkdir -p OpenSearch-Dashboards/plugins
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,20 @@ jobs:
ref: ${{ steps.opensearch_dashboards_version.outputs.opensearch_dashboards_version }}
token: ${{ secrets.GITHUB_OPENSEARCH_DASHBOARDS_OSS }}
path: OpenSearch-Dashboards
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
- name: Setup node
uses: actions/setup-node@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.node_version }}
node-version-file: './OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install correct yarn version for OpenSearch-Dashboards
- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions.outputs.yarn_version }}
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v
- name: Bootstrap plugin/OpenSearch-Dashboards
run: |
mkdir -p OpenSearch-Dashboards/plugins
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ jobs:
repository: opensearch-project/OpenSearch-Dashboards
ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }}
path: OpenSearch-Dashboards
- name: Get node and yarn versions
id: versions
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
- name: Setup node
uses: actions/setup-node@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.node_version }}
node-version-file: './OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install correct yarn version for OpenSearch-Dashboards
- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions.outputs.yarn_version }}
YARN_VERSION=$(node -p "require('./OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v
- name: Checkout Index Management Dashboards plugin
uses: actions/checkout@v2
with:
Expand Down

0 comments on commit 092ea63

Please sign in to comment.