这是indexloc提供的服务,不要输入任何密码
Skip to content

Fix e2e example check #580

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

Merged
merged 3 commits into from
Jan 21, 2022
Merged
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
22 changes: 17 additions & 5 deletions scripts/run-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ echo "=> Running examples..."
echo "=> Building turbo from source..."
cd cli && CGO_ENABLED=0 go build ./cmd/turbo/... && cd ..;
export TURBO_BINARY_PATH=$(pwd)/cli/turbo
export TURBO_VERSION=$(head -n 1 $(pwd)/cli/version.txt)
export TURBO_TAG=$(cat $(pwd)/cli/version.txt | sed -n '2 p')

echo "=> Binary path: TURBO_BINARY_PATH=$TURBO_BINARY_PATH"
echo "=> Local Turbo Version: TURBO_VERSION=$TURBO_VERSION"
echo "=> Moving our own eslint settings out of the way..."
echo "=> Actually running examples for real..."

if [ -f ".eslintrc.js" ]; then
mv .eslintrc.js .eslintrc.js.bak
fi

echo "'env:\n\tTURBO_BINARY_PATH: $TURBO_BINARY_PATH'" > examples/.yarnrc;

function cleanup {
rm -rf node_modules
rm -rf apps/*/node_modules
Expand Down Expand Up @@ -51,6 +54,12 @@ for folder in examples/* ; do
echo "======================================================="
echo "=> checking $folder "
echo "======================================================="

cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json
if [ "$TURBO_TAG" == "canary" ]; then
cat package.json | jq '.devDependencies.turbo = "canary"' | sponge package.json
fi

if [ "$folder" != "examples/with-pnpm" ]; then

# cleanup
Expand All @@ -77,8 +86,7 @@ for folder in examples/* ; do

cleanup
setup_git

cat package.json | jq '.packageManager = "yarn@1.22.17"' | sponge package.json


echo "======================================================="
echo "=> $folder: yarn install"
Expand Down Expand Up @@ -144,4 +152,8 @@ if [[ ! -z $(git status -s | grep -v package.json) ]];then
exit 1
fi

rm -rf examples/.yarnrc;
cat package.json | jq 'del(.packageManager)' | sponge package.json

if [ "$TURBO_TAG" == "canary" ]; then
cat package.json | jq '.devDependencies.turbo = "latest"' | sponge package.json
fi