forked from Teradata/covalent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(CI): parallelize CI tests plus add release and aot check (Terad…
…ata#1067) * chore(ci): parallelize CI tests * chore(): combine everything into a file * make script.sh executable * chore(): fix if/else statement * chore(): fix unit test execution * fix(): travis and try again * fix(): one last fix * chore(): remove extra space
- Loading branch information
1 parent
15ed22b
commit 287f9d5
Showing
3 changed files
with
62 additions
and
10 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,47 @@ | ||
#!/bin/bash | ||
|
||
# Script that runs in every Travis CI container. | ||
# Responsible for testing the project in different Travis jobs of the current build stage. | ||
|
||
# The script should immediately exit if any command in the script fails. | ||
set -e | ||
|
||
# Go to project directory | ||
cd $(dirname $0)/../.. | ||
|
||
if [[ -z "$TRAVIS" ]]; then | ||
echo "This script can only run inside of Travis build jobs." | ||
exit 1 | ||
fi | ||
|
||
echo "" | ||
echo "Building sources and running tests. Running mode: ${MODE}" | ||
echo "" | ||
|
||
# Get commit diff | ||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then | ||
fileDiff=$(git diff --name-only $TRAVIS_COMMIT_RANGE) | ||
else | ||
fileDiff=$(git diff --name-only $TRAVIS_BRANCH...HEAD) | ||
fi | ||
|
||
# Check if tests can be skipped | ||
if [[ ${fileDiff} =~ ^(.*\.md\s*)*$ ]]; then | ||
echo "Skipping tests since only markdown files changed." | ||
exit 0 | ||
fi | ||
|
||
if [ "${MODE}" = "lint" ]; then | ||
npm run lint | ||
elif [ "${MODE}" = "aot" ]; then | ||
npm run build:docs | ||
elif [ "${MODE}" = "release" ]; then | ||
npm run build:release | ||
elif [ "${MODE}" = "unit-test" ]; then | ||
npm run test | ||
fi | ||
|
||
# Upload coverage results if those are present. | ||
if [ -f coverage/lcov.info ]; then | ||
npm run coveralls | ||
fi |
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