File: e2e-setup-ci.sh

package info (click to toggle)
node-yarnpkg 4.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,752 kB
  • sloc: javascript: 38,953; ansic: 26,035; cpp: 7,247; sh: 2,829; makefile: 724; perl: 493
file content (49 lines) | stat: -rw-r--r-- 1,459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash

set -e

HERE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
TEMP_DIR="$(mktemp -d)"

cd "${TEMP_DIR}"

# We want to ensure we're using the latest release
ROOT_DIR="$(dirname ${HERE_DIR})"
export PATH="${ROOT_DIR}/packages/yarnpkg-cli/bundles:${PATH}"
cp "$ROOT_DIR/packages/yarnpkg-cli/bundles/yarn.js" "$ROOT_DIR/packages/yarnpkg-cli/bundles/yarn"
cp "$ROOT_DIR/packages/yarnpkg-cli/bundles/yarn.js" "$ROOT_DIR/packages/yarnpkg-cli/bundles/yarnpkg"
chmod +x "$ROOT_DIR/packages/yarnpkg-cli/bundles/yarn"
chmod +x "$ROOT_DIR/packages/yarnpkg-cli/bundles/yarnpkg"

echo PATH: $PATH
echo Yarn Path: $(which yarn)
echo Yarn Version: $(yarn -v)

# We want to see what fails (if anything fails)
export YARN_ENABLE_INLINE_BUILDS=1

# We want to allow installs to modify the lockfile
export YARN_ENABLE_IMMUTABLE_INSTALLS=0

# We want to make sure the projects work in a monorepo
export YARN_PNP_FALLBACK_MODE=none

# Otherwise git commit doesn't work, and some tools require it
git config --global user.email "you@example.com"
git config --global user.name "John Doe"

# We want all e2e tests to fail on unhandled rejections
export NODE_OPTIONS="--unhandled-rejections=strict"

if [[ "$1" == "nm" ]]; then
  NODE_LINKER="node-modules"
elif [[ -z "$1" || "$1" == "pnp" ]]; then
  NODE_LINKER="pnp"
else
  echo "Invalid nodeLinker: $1"
  exit 1
fi

yarn config set -H nodeLinker "$NODE_LINKER"

echo nodeLinker: $NODE_LINKER