Skip to content
Permalink
Browse files

tests: Fix lockfile check (#29730)

* tests: Check for dirty yarn.lock

* fix: Better lockfile check

* Add exit

* Don't freeze lockfile, so we can test for it
  • Loading branch information
ascorbic committed Feb 24, 2021
1 parent affb1d6 commit e4e58090738b52740c13cce477fe8539ac768b2e
Showing with 13 additions and 1 deletion.
  1. +7 −1 .circleci/config.yml
  2. +6 −0 scripts/check-lockfile.sh
@@ -26,7 +26,12 @@ aliases:
install_node_modules: &install_node_modules
run:
name: Install node modules
command: yarn --frozen-lockfile
command: yarn

check_lockfile: &check_lockfile
run:
name: Check for dirty lockfile
command: ./scripts/check-lockfile.sh || exit 1

persist_cache: &persist_cache
save_cache:
@@ -177,6 +182,7 @@ jobs:
- run: ./scripts/assert-changed-files.sh "packages/*|(e2e|integration)-tests/*|.circleci/*|yarn.lock"
- <<: *restore_cache
- <<: *install_node_modules
- <<: *check_lockfile
- <<: *persist_cache
- run: yarn bootstrap -- concurrency=2
- run: git status yarn.lock -s | grep "M yarn.lock" && echo "yarn.lock is dirty. Please ensure changes have been committed" && exit 1
@@ -0,0 +1,6 @@
#!/bin/bash
if git status --porcelain yarn.lock | grep "M yarn.lock"
then echo "yarn.lock is dirty. Please ensure changes have been committed"
exit 1
else exit 0
fi

0 comments on commit e4e5809

Please sign in to comment.