diff --git a/.github/actions/base-setup/action.yml b/.github/actions/base-setup/action.yml index a4193d8..d944efb 100644 --- a/.github/actions/base-setup/action.yml +++ b/.github/actions/base-setup/action.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2e14051..2350dde 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 @@ -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 diff --git a/package.json b/package.json index d661637..07ae36b 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "@jupyterlab/maintainer-tools", "version": "0.25.9", - "private": true + "private": true, + "packageManager": "yarn@3.5.0" }