From 7f3aab719954dd688c95bc1bffa68cb31159697e Mon Sep 17 00:00:00 2001 From: Jordan Reimer Date: Tue, 4 Apr 2023 15:39:17 -0600 Subject: [PATCH] Node Version CI Update (#19978) * updates github workflows to read node version from .nvmrc file * updates to double quotes for shell expression * removes set-output workflow command * updates to use node-version-file option for gh workflows * pins node version to 16 --- .github/workflows/build-vault-oss.yml | 2 +- .github/workflows/ci.yml | 4 ++-- .github/workflows/test-enos-scenario-ui.yml | 8 ++------ ui/.nvmrc | 1 - ui/package.json | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 ui/.nvmrc diff --git a/.github/workflows/build-vault-oss.yml b/.github/workflows/build-vault-oss.yml index 0c3197e2aaeb..eba7457c5b6e 100644 --- a/.github/workflows/build-vault-oss.yml +++ b/.github/workflows/build-vault-oss.yml @@ -47,7 +47,7 @@ jobs: - name: Set up node and yarn uses: actions/setup-node@v3 with: - node-version: 16 + node-version-file: './ui/package.json' cache: yarn cache-dependency-path: ui/yarn.lock - name: Build UI diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 100c4157bba9..2cf4fa129a6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -204,14 +204,14 @@ jobs: # Setup node.js without caching to allow running npm install -g yarn (next step) - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c with: - node-version: 16 + node-version-file: './ui/package.json' - id: install-yarn run: | npm install -g yarn # Setup node.js with caching using the yarn.lock file - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c with: - node-version: 16 + node-version-file: './ui/package.json' cache: yarn cache-dependency-path: ui/yarn.lock - id: install-browser-libraries diff --git a/.github/workflows/test-enos-scenario-ui.yml b/.github/workflows/test-enos-scenario-ui.yml index 9fa25bd0f3b2..035d209572e8 100644 --- a/.github/workflows/test-enos-scenario-ui.yml +++ b/.github/workflows/test-enos-scenario-ui.yml @@ -32,8 +32,6 @@ jobs: name: Get metadata runs-on: ubuntu-latest outputs: - go-version: ${{ steps.get-metadata.outputs.go-version }} - node-version: ${{ steps.get-metadata.outputs.node-version }} runs-on: ${{ steps.get-metadata.outputs.runs-on }} vault_edition: ${{ steps.get-metadata.outputs.vault_edition }} steps: @@ -42,8 +40,6 @@ jobs: env: IS_ENT: ${{ startsWith(github.event.repository.name, 'vault-enterprise' ) }} run: | - echo "go-version=$(cat ./.go-version)" >> "$GITHUB_OUTPUT" - echo "node-version=$(cat ./ui/.nvmrc)" >> "$GITHUB_OUTPUT" if [ "$IS_ENT" == true ]; then echo "detected vault_edition=ent" echo "runs-on=['self-hosted', 'ondemand', 'os=linux', 'type=m5d.4xlarge']" >> "$GITHUB_OUTPUT" @@ -75,7 +71,7 @@ jobs: - name: Set Up Go uses: actions/setup-go@v3 with: - go-version: ${{ needs.get-metadata.outputs.go-version }} + go-version-file: ./.go-version - uses: hashicorp/action-setup-enos@v1 with: github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} @@ -84,7 +80,7 @@ jobs: - name: Set Up Node uses: actions/setup-node@v3 with: - node-version: ${{ needs.get-metadata.outputs.node-version }} + node-version-file: './ui/package.json' - name: Set Up Terraform uses: hashicorp/setup-terraform@v2 with: diff --git a/ui/.nvmrc b/ui/.nvmrc deleted file mode 100644 index 6f7f377bf514..000000000000 --- a/ui/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v16 diff --git a/ui/package.json b/ui/package.json index ef558b82d345..e52812d44e35 100644 --- a/ui/package.json +++ b/ui/package.json @@ -226,7 +226,7 @@ "@hashicorp/ember-flight-icons": "2.0.3" }, "engines": { - "node": ">= 16" + "node": "16" }, "ember": { "edition": "octane"