From b1850b6e9a015a0da2295f3c86da909236e951fc Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Mon, 10 Jan 2022 12:08:40 +0100 Subject: [PATCH 1/4] use actions/setup-node@v2 for test --- .github/workflows/test.yml | 54 +++++--------------------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbf819a7b..49f8a407f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,17 +15,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v2 - - - name: Read Node.js version (Unix) - id: nodejs-version - run: | - content=`cat ./.nvmrc` - echo "::set-output name=content::$content" - - name: Setup Node.js - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - # See https://github.com/actions/setup-node/issues/32 - node-version: ${{ steps.nodejs-version.outputs.content }} + node-version-file: '.nvmrc' - name: npm install run: npm install - name: lint @@ -45,25 +37,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v2 - - - name: Read Node.js version (Unix) - if: ${{ runner.os != 'Windows' }} - id: nodejs-version-unix - run: | - content=`cat ./.nvmrc` - echo "::set-output name=content::$content" - - - name: Read Node.js version (Windows) - if: ${{ runner.os == 'Windows' }} - id: nodejs-version-win - run: | - $content = Get-Content .\.nvmrc -Raw - echo "::set-output name=content::$content" - - name: Setup Node.js - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - # See https://github.com/actions/setup-node/issues/32 - node-version: ${{ steps.nodejs-version-unix.outputs.content || steps.nodejs-version-win.outputs.content }} + node-version-file: '.nvmrc' - name: npm install run: npm ci - name: unit test @@ -83,25 +59,9 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v2 - - - name: Read Node.js version (Unix) - if: ${{ runner.os != 'Windows' }} - id: nodejs-version-unix - run: | - content=`cat ./.nvmrc` - echo "::set-output name=content::$content" - - - name: Read Node.js version (Windows) - if: ${{ runner.os == 'Windows' }} - id: nodejs-version-win - run: | - $content = Get-Content .\.nvmrc -Raw - echo "::set-output name=content::$content" - - name: Setup Node.js - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - # See https://github.com/actions/setup-node/issues/32 - node-version: ${{ steps.nodejs-version-unix.outputs.content || steps.nodejs-version-win.outputs.content }} + node-version-file: '.nvmrc' - name: Set up Xvfb (Ubuntu) run: | /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & @@ -111,7 +71,7 @@ jobs: uses: hashicorp/setup-terraform@v1 with: terraform_wrapper: false - terraform_version: "~1.0" + terraform_version: '~1.0' - name: Clean Install Dependencies run: npm ci - name: Run Tests From 953defd2dc810475d86660564bc5ff5696d0f90d Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Mon, 10 Jan 2022 12:09:05 +0100 Subject: [PATCH 2/4] use actions/setup-node@v2 for build --- .github/workflows/build.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40e0193e1..3184ec467 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,21 +12,13 @@ jobs: - name: checkout repo uses: actions/checkout@v2 - - name: Read NodeJS version - id: nodejs-version - run: | - content=`cat ./.nvmrc` - echo "::set-output name=content::$content" - - - name: setup node - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - # See https://github.com/actions/setup-node/issues/32 - node-version: ${{ steps.nodejs-version.outputs.content }} + node-version-file: '.nvmrc' - name: clean install dependencies - run: npm ci - + run: npm ci + - name: compile and create vsix run: npm run package -- -o extension.vsix From 1ad5b09654c6887d4d00bd321f576d40410643bc Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Mon, 10 Jan 2022 12:09:15 +0100 Subject: [PATCH 3/4] use actions/setup-node@v2 for publish --- .github/workflows/publish.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 70ffcb828..7750850f8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -24,16 +24,9 @@ jobs: echo "Received ref: ${{ github.ref }}" echo "Expected ref: refs/tags/v${{ steps.ext-version.outputs.content }}" exit 1 - - name: Read Node.js version - id: nodejs-version - run: | - content=`cat ./.nvmrc` - echo "::set-output name=content::$content" - - name: Set up Node.js - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - # See https://github.com/actions/setup-node/issues/32 - node-version: ${{ steps.nodejs-version.outputs.content }} + node-version-file: '.nvmrc' - name: Install dependencies run: npm ci - name: vsce package From 720e3dc7bd4860bf0e11c81c787b60d3c0599b5c Mon Sep 17 00:00:00 2001 From: Daniel Banck Date: Mon, 10 Jan 2022 12:10:09 +0100 Subject: [PATCH 4/4] simplify preview with actions/setup-node@v2 --- .github/workflows/preview.yml | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 94f182bf0..00dce0793 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -24,18 +24,9 @@ jobs: content=`cat ./package.json | jq -r .version` echo "::set-output name=content::$content" - - name: Read Node.js version - id: nodejs-version - run: | - content=`cat ./.nvmrc` - echo "::set-output name=content::$content" - - - name: Set up Node.js - uses: actions/setup-node@v2 + - uses: actions/setup-node@v2 with: - # See https://github.com/actions/setup-node/issues/32 - node-version: ${{ steps.nodejs-version.outputs.content }} - cache: 'npm' + node-version-file: '.nvmrc' - name: Install dependencies run: npm ci