Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable corepack if packageManager is defined #241

Merged
merged 3 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/base-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ runs:
id: yarn-cache-dir-path
shell: bash
run: |
# Enable corepack if the project defines packageManager
if [ -f package.json ]; then
export HAS_PKG_MANAGER=$(grep -e \"packageManager\"\: package.json)
if [ ! -z "$HAS_PKG_MANAGER" ]; then corepack enable; fi
fi
CACHE_DIR=$(yarn config get cacheFolder)
[[ "$CACHE_DIR" == "undefined" ]] && CACHE_DIR=$(yarn cache dir)
echo "dir=$CACHE_DIR" >> $GITHUB_OUTPUT
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: ./.github/actions/base-setup
- name: Run Linters
run: |
hatch run typing:test
Expand Down Expand Up @@ -162,6 +162,9 @@ jobs:
run: |
mkdir -p ${TEST_FOLDER}/tests/example.spec.ts-snapshots
pushd ${TEST_FOLDER}

# Prevent yarn to look up in the folder hierarchy
touch yarn.lock
yarn init -yp
yarn add -D @playwright/test
cat package.json | jq '. += {"scripts": {"start": "echo starting...", "test:update": "yarn playwright test -u"}}' > new_package.json
Expand Down Expand Up @@ -205,6 +208,9 @@ jobs:
run: |
mkdir -p ${TEST_FOLDER}/tests/example.spec.ts-snapshots
pushd ${TEST_FOLDER}

# Prevent yarn to look up in the folder hierarchy
touch yarn.lock
yarn init -yp
yarn add -D @playwright/test
cat package.json | jq '. += {"scripts": {"test:update": "yarn playwright test -u"}}' > new_package.json
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "@jupyterlab/maintainer-tools",
"version": "0.25.9",
"private": true
"private": true,
"packageManager": "yarn@3.5.0"
}
Loading