-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail in CI when package tests fail (#5718)
* Fail in CI when package tests fail Fixes #5713 Co-authored-by: chris48s <[email protected]>
- Loading branch information
1 parent
aa5addb
commit e1bd160
Showing
2 changed files
with
38 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
# https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/3 | ||
|
||
# Start off less strict to work around various nvm errors. | ||
set -e | ||
export NVM_DIR="/opt/circleci/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" | ||
nvm install $NODE_VERSION | ||
nvm use $NODE_VERSION | ||
|
||
# Stricter. | ||
set -euo pipefail | ||
node --version | ||
|
||
# Install the shields.io dependencies. | ||
if [[ "$NODE_VERSION" == "v10" ]]; then | ||
# Avoid a depcheck error. | ||
npm ci --ignore-scripts | ||
else | ||
npm ci | ||
fi | ||
|
||
# Run the package tests. | ||
npm run test:package | ||
npm run check-types:package | ||
|
||
# Delete the shields.io dependencies. | ||
rm -rf node_modules/ | ||
|
||
# Run a smoke test (render a badge with the CLI) with only the package | ||
# dependencies installed. | ||
cd badge-maker | ||
npm link | ||
badge cactus grown :green @flat |