remove use-node-version from .npmrc during build. the node version is already configured as separate action in job

removed previous workaround for pnpm and updated node version consistently across jobs
This commit is contained in:
starbirdtech383
2023-10-20 16:45:23 +05:30
parent 3f47c35da2
commit 2ae35b0105
6 changed files with 20 additions and 39 deletions

View File

@@ -36,7 +36,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
version: 8.8.0
- name: Setup Node
uses: actions/setup-node@v3
with:
@@ -45,6 +45,8 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc
- name: Get pnpm store directory
shell: bash
run: |
@@ -73,11 +75,13 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.14.0
node-version: 18.17.1
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc
- name: Get pnpm store directory
shell: bash
run: |

View File

@@ -18,31 +18,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check node,pnpm Installation and set Path
shell: bash
working-directory: scripts/self-hosted-gh-runner
timeout-minutes: 1
run: |
./node-pnpm-check.sh
echo "make sure below mentioned versions are expected versions"
echo "If you are expecting the node and pnpm versions to be updated. Please update the node-pnpm-check.sh script"
env
- name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc
- name: Setup Node
if: ${{ env.SETUP_NODE != 'false' }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NC_REQ_NODE_V }}
node-version: 18.17.1
- name: Setup pnpm
if: ${{ env.SETUP_PNPM != 'false' }}
uses: pnpm/action-setup@v2
with:
version: ${{ env.NC_REQ_PNPM_V }}
version: 8.8.0
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=/root/setup-pnpm/node_modules/.bin/store/v3" >> $GITHUB_ENV
- uses: actions/cache@v3
if: env.IS_NPM_CACHE_DOWNLOAD_REQUIRED == 'true'
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}

View File

@@ -2,13 +2,7 @@ name: pre-build-for-playwright
on:
workflow_call:
inputs:
FORCE_RUN_PRERQUISITE_STEPS:
description: 'FORCE_RUN_PRERQUISITE_STEPS'
required: false
type: string
default: 'false'
jobs:
playwright:
runs-on: [self-hosted, v3]
@@ -16,31 +10,21 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check node,pnpm Installation and set Path
shell: bash
working-directory: scripts/self-hosted-gh-runner
timeout-minutes: 1
run: |
./node-pnpm-check.sh
echo "make sure below mentioned versions are expected versions"
echo "If you are expecting the node and pnpm versions to be updated. Please update the node-pnpm-check.sh script"
env
- name: Setup Node
if: ${{ env.SETUP_NODE != 'false' }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NC_REQ_NODE_V }}
node-version: 18.17.1
- name: Setup pnpm
if: ${{ env.SETUP_PNPM != 'false' }}
uses: pnpm/action-setup@v2
with:
version: ${{ env.NC_REQ_PNPM_V }}
version: 8.8.0
- name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=/root/setup-pnpm/node_modules/.bin/store/v3" >> $GITHUB_ENV
- uses: actions/cache@v3
if: env.IS_NPM_CACHE_DOWNLOAD_REQUIRED == 'true'
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}

View File

@@ -25,6 +25,7 @@ jobs:
- name: Get pnpm store directory
shell: bash
run: |
sed -i '/^use-node-version/d' .npmrc
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache

View File

@@ -34,6 +34,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: remove use-node-version from .npmrc
run: sed -i '/^use-node-version/d' .npmrc
- name: install dependencies
run: pnpm bootstrap
- name: run unit tests

View File

@@ -20,9 +20,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 0
- run: |
sed -i '/^use-node-version/d' .npmrc
pnpm bootstrap
- name: Create Pull Request