Commit 7e47a92c authored by Sam Saccone's avatar Sam Saccone

Merge pull request #1288 from tastejs/sjs/run-jscs

test work!
parents a0802acc 92fcc737
/node_modules /node_modules
/bower_components /bower_components
/dist /dist
/tooling/node_modules
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"function", "function",
"typeof" "typeof"
], ],
"excludeFiles": ["**/node_modules/**", "**/bower_components/**"],
"requireSpaceBeforeBlockStatements": true, "requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true, "requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true, "requireSpacesInConditionalExpression": true,
......
...@@ -38,4 +38,4 @@ before_script: ...@@ -38,4 +38,4 @@ before_script:
script: script:
# We want to gate on passing tests and a successful build # We want to gate on passing tests and a successful build
- gulp - gulp
- ./travis-runner.sh - ./test-runner.sh
#!/bin/bash
set -o pipefail
get_changes ()
{
git remote add current https://github.com/tastejs/todomvc.git && \
git fetch --quiet current && \
git diff HEAD origin/master --name-only | awk 'BEGIN {FS = "/"}; {print $1 "/" $2 "/" $3}' | uniq | grep -v \/\/ | grep examples | awk -F '[/]' '{print "--framework=" $2}'
}
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} site > /dev/null 2>&1
cd site
if git checkout gh-pages; then git checkout -b gh-pages; fi
git rm -r .
cp -R ../dist/* .
cp ../dist/.* .
git add -f .
git config user.email 'travis@rdrei.net'
git config user.name 'TasteBot'
git commit -am 'update the build files for gh-pages [ci skip]'
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages > /dev/null 2>&1
else
changes=$(get_changes)
if [ "${#changes}" = 0 ]
then
exit 0
else
cd tooling && \
echo $changes | xargs ./run.sh && \
cd ../tests && \
echo $changes | xargs ./run.sh
fi
exit $?
fi
#!/bin/bash
args="$@"
run_tests ()
{
npm i && \
eval "npm test -- $args"
}
if [ "$TRAVIS_PULL_REQUEST" == "true" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "true" ]
then
run_tests
elif [ "$TRAVIS_PULL_REQUEST" == "true" ] && [ "$TRAVIS_SECURE_ENV_VARS" == "false" ]
then
exit 0
else
run_tests
fi
{
"private": true,
"scripts": {
"lint": "jscs"
},
"dependencies": {
"jscs": "^1.13.1"
}
}
#!/bin/bash
PATHS=""
EXAMPLES_DIR="../examples/"
for arg in "$@"
do
case $arg in
--framework=*)
PATHS+=" "$EXAMPLES_DIR$(echo $arg | awk '{split($0,a,"="); print a[2]}')
;;
esac
done
npm i && \
eval "npm run lint -- -c ../.jscsrc $PATHS"
#!/bin/bash
set -o pipefail
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
git submodule add -b gh-pages https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} site > /dev/null 2>&1
cd site
if git checkout gh-pages; then git checkout -b gh-pages; fi
git rm -r .
cp -R ../dist/* .
cp ../dist/.* .
git add -f .
git config user.email 'travis@rdrei.net'
git config user.name 'TasteBot'
git commit -am 'update the build files for gh-pages [ci skip]'
# Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token
git push https://${GH_OAUTH_TOKEN}@github.com/${GH_OWNER}/${GH_PROJECT_NAME} HEAD:gh-pages > /dev/null 2>&1
else
git remote add current https://github.com/tastejs/todomvc.git && \
git fetch current && \
cd browser-tests/ && \
npm i && \
changes=$(git diff HEAD origin/master --name-only | awk 'BEGIN {FS = "/"}; {print $1 "/" $2 "/" $3}' | uniq | grep -v \/\/ | grep examples | awk -F '[/]' '{print "--framework=" $2}')
if [ "${#changes}" = 0 ]
then
exit 0
else
echo changes | xargs npm run test --
fi
exit $?
fi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment