File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ jobs:
233233 cat "$OUTPUT"
234234 grep -F "Set VP_BIN_DIR, VP_DATA_DIR, and VP_CACHE_DIR together" "$OUTPUT"
235235
236- - name : Existing setup-vp uses legacy layout
236+ - name : Existing GitHub setup-vp uses legacy layout
237237 run : |
238238 set -euo pipefail
239239 LEGACY=$(mktemp -d)
@@ -252,6 +252,27 @@ jobs:
252252 test "$(readlink "$LEGACY/.vite-plus/bin/vp")" = "$LEGACY/.vite-plus/current/bin/vp"
253253 "$LEGACY/.vite-plus/bin/vp" --version
254254
255+ - name : Existing GitLab setup-vp uses legacy layout
256+ run : |
257+ set -euo pipefail
258+ LEGACY=$(mktemp -d)
259+ FAKE_TGZ=$(mktemp)
260+ export HOME="$LEGACY"
261+ export USERPROFILE="$LEGACY"
262+ unset GITHUB_ACTION_REPOSITORY
263+ export GITLAB_CI=true
264+ export SETUP_VP_SETUP_REF=v1.15.0
265+ unset VP_VPDIRS_AWARE
266+ unset VP_HOME VP_BIN_DIR VP_DATA_DIR VP_CACHE_DIR
267+ unset XDG_DATA_HOME XDG_CACHE_HOME XDG_CONFIG_HOME XDG_STATE_HOME
268+ VP_LOCAL_TGZ="$FAKE_TGZ" VP_VERSION=local-setup-vp-gitlab-legacy bash packages/cli/install.sh
269+
270+ test -e "$LEGACY/.vite-plus/current"
271+ test -e "$LEGACY/.vite-plus/bin/vp"
272+ test ! -d "$LEGACY/.local/share/vite-plus"
273+ test "$(readlink "$LEGACY/.vite-plus/bin/vp")" = "$LEGACY/.vite-plus/current/bin/vp"
274+ "$LEGACY/.vite-plus/bin/vp" --version
275+
255276 - name : Fresh home uses split layout
256277 run : |
257278 set -euo pipefail
Original file line number Diff line number Diff line change @@ -176,11 +176,14 @@ resolution_home_dir() {
176176 fi
177177}
178178
179- # Released setup-vp versions add ~/.vite-plus/bin to the GitHub Actions PATH.
180- # They do this after the installer exits. Use the monolithic layout until
181- # setup-vp declares support for VP_DUMP_DIRS.
179+ # Released setup-vp versions add ~/.vite-plus/bin to the GitHub Actions or
180+ # GitLab CI/CD PATH. They do this after the installer exits. Use the monolithic
181+ # layout until setup-vp declares support for VP_DUMP_DIRS.
182182enable_setup_vp_legacy_compatibility () {
183- [ " ${GITHUB_ACTION_REPOSITORY:- } " = " voidzero-dev/setup-vp" ] || return 0
183+ if [ " ${GITHUB_ACTION_REPOSITORY:- } " != " voidzero-dev/setup-vp" ]; then
184+ [ " ${GITLAB_CI:- } " = " true" ] || return 0
185+ [ -n " ${SETUP_VP_SETUP_REF:- } " ] || return 0
186+ fi
184187 [ " ${VP_VPDIRS_AWARE:- } " != " 1" ] || return 0
185188 [ -z " ${VP_HOME:- } " ] || return 0
186189 [ -z " ${VP_BIN_DIR:- } " ] || return 0
You can’t perform that action at this time.
0 commit comments