From bbe39411d836976b27cf6ddb1e3aeae15d03f0bd Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Sat, 1 Oct 2022 23:19:05 +0530 Subject: [PATCH] Update workflows to resolve node version from nvmrc --- .github/workflows/do-spaces-workflow.yml | 16 ++------ .github/workflows/gh-pages-workflow.yml | 16 ++------ .github/workflows/test-workflow.yml | 48 ++++++------------------ 3 files changed, 20 insertions(+), 60 deletions(-) diff --git a/.github/workflows/do-spaces-workflow.yml b/.github/workflows/do-spaces-workflow.yml index 6e2cef5..f4dbd46 100644 --- a/.github/workflows/do-spaces-workflow.yml +++ b/.github/workflows/do-spaces-workflow.yml @@ -9,19 +9,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Read Node.js & NPM versions - run: | - echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')" - echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')" - id: versions - - - name: Use correct Node.js version - uses: actions/setup-node@v2 + - name: Setup Node + uses: actions/setup-node@v3.5.0 with: - node-version: "${{ steps.versions.outputs.NODE }}" - - - name: Use correct NPM version - run: npm i -g npm@"${{ steps.versions.outputs.NPM }}" + node-version-file: ".nvmrc" + cache: npm - name: Install dependencies run: npm ci diff --git a/.github/workflows/gh-pages-workflow.yml b/.github/workflows/gh-pages-workflow.yml index e106a0a..e6ca076 100644 --- a/.github/workflows/gh-pages-workflow.yml +++ b/.github/workflows/gh-pages-workflow.yml @@ -12,19 +12,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Read Node.js & NPM versions - run: | - echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')" - echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')" - id: versions - - - name: Use correct Node.js version - uses: actions/setup-node@v2 + - name: Setup Node + uses: actions/setup-node@v3.5.0 with: - node-version: "${{ steps.versions.outputs.NODE }}" - - - name: Use correct NPM version - run: npm i -g npm@"${{ steps.versions.outputs.NPM }}" + node-version-file: ".nvmrc" + cache: npm - name: Install dependencies run: npm ci diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index daca85f..b69bc52 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -9,19 +9,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Read Node.js & NPM versions - run: | - echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')" - echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')" - id: versions - - - name: Use correct Node.js version - uses: actions/setup-node@v2 + - name: Setup Node + uses: actions/setup-node@v3.5.0 with: - node-version: "${{ steps.versions.outputs.NODE }}" - - - name: Use correct NPM version - run: npm i -g npm@"${{ steps.versions.outputs.NPM }}" + node-version-file: ".nvmrc" + cache: npm - name: Install dependencies run: npm ci @@ -35,19 +27,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Read Node.js & NPM versions - run: | - echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')" - echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')" - id: versions - - - name: Use correct Node.js version - uses: actions/setup-node@v2 + - name: Setup Node + uses: actions/setup-node@v3.5.0 with: - node-version: "${{ steps.versions.outputs.NODE }}" - - - name: Use correct NPM version - run: npm i -g npm@"${{ steps.versions.outputs.NPM }}" + node-version-file: ".nvmrc" + cache: npm - name: Install dependencies run: npm ci @@ -61,19 +45,11 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Read Node.js & NPM versions - run: | - echo "##[set-output name=NODE;]$(cat package.json | jq -r '.engines.node')" - echo "##[set-output name=NPM;]$(cat package.json | jq -r '.engines.npm')" - id: versions - - - name: Use correct Node.js version - uses: actions/setup-node@v2 + - name: Setup Node + uses: actions/setup-node@v3.5.0 with: - node-version: "${{ steps.versions.outputs.NODE }}" - - - name: Use correct NPM version - run: npm i -g npm@"${{ steps.versions.outputs.NPM }}" + node-version-file: ".nvmrc" + cache: npm - name: Install dependencies run: npm ci