From 019751d27916574e909809ba9ccd8171da1ce055 Mon Sep 17 00:00:00 2001 From: Guillaume Galy Date: Mon, 4 Dec 2023 15:57:47 +0100 Subject: [PATCH] fix: enable corepack to honor packageManager setting Motivation: - packageManager setting isn't used of corepack isn't enabled - recent versions of yarn 1 will output an error if packageManager is set but corepack isn't enabled (before 'yarn set version' command is effective) Modifications: Enable corepack in CI workflows. Result: Avoid error in CI workflows. --- .github/workflows/build.yml | 12 ++++++++---- .github/workflows/publish.yml | 5 ++++- .github/workflows/run-enterprise-action.yml | 11 ++++++++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb851af..685534c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,13 +21,17 @@ jobs: uses: actions/setup-node@v4 with: node-version: 16 - cache: 'yarn' - - - name: Install dependencies - run: yarn ci + # cache is broken until we can enable Corepack directly in setup-node + # instead of having to wait to enable it manually later. + # See https://github.com/actions/setup-node/issues/531. + # cache: 'yarn' - name: Execute build run: | + corepack enable + yarn config set nodeLinker node-modules + yarn plugin import workspace-tools + yarn install --immutable yarn format-check yarn test yarn package diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d9cd818..6e00b90 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,10 @@ jobs: - name: Build run: | - yarn ci + corepack enable + yarn config set nodeLinker node-modules + yarn plugin import workspace-tools + yarn install --immutable yarn format-check yarn test yarn package diff --git a/.github/workflows/run-enterprise-action.yml b/.github/workflows/run-enterprise-action.yml index c2d7028..acce96d 100644 --- a/.github/workflows/run-enterprise-action.yml +++ b/.github/workflows/run-enterprise-action.yml @@ -33,11 +33,17 @@ jobs: uses: actions/setup-node@v4 with: node-version: 16 - cache: 'yarn' + # cache is broken until we can enable Corepack directly in setup-node + # instead of having to wait to enable it manually later. + # See https://github.com/actions/setup-node/issues/531. + # cache: 'yarn' - name: Build run: | - yarn ci + corepack enable + yarn config set nodeLinker node-modules + yarn plugin import workspace-tools + yarn install --immutable yarn package - name: Gatling Enterprise Action @@ -65,4 +71,3 @@ jobs: echo "Deprecated outputs:" echo "runs_status_code=${{ steps.enterprise-action.outputs.runs_status_code }}" echo "runs_status_name=${{ steps.enterprise-action.outputs.runs_status_name }}" -