Skip to content

Commit

Permalink
fix: enable corepack to honor packageManager setting
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guilgaly committed Dec 5, 2023
1 parent 757591a commit 019751d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/run-enterprise-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}"

0 comments on commit 019751d

Please sign in to comment.