Skip to content

Commit

Permalink
Use node-version-file instead of reading and adding to env
Browse files Browse the repository at this point in the history
  • Loading branch information
ndv99 committed Nov 16, 2023
1 parent faec908 commit 178948d
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@ on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
read-node-version:
name: "Read NodeJS version"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: "Read .nvmrc"
run: "echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV"
lint:
name: Lint
needs: read-node-version
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -25,18 +17,17 @@ jobs:
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js ${{ env.NVMRC }}
- name: Use Node.js from .nvrmc
uses: actions/setup-node@v3
with:
node-version: ${{ env.NVMRC }}
node-version-file: '.nvrmc'
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: CYPRESS_INSTALL_BINARY=0 yarn install
- run: yarn lint

test:
name: Test
needs: read-node-version
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -46,10 +37,10 @@ jobs:
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Use Node.js ${{ env.NVMRC }}
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version: ${{ env.NVMRC }}
node-version-file: '.nvmrc'
- name: Install
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: CYPRESS_INSTALL_BINARY=0 yarn install
Expand Down

0 comments on commit 178948d

Please sign in to comment.