build(CI): Fix bash logic to fail build when ui tests fail
@@ -13,14 +13,15 @@ script:
- npm run check:themes
- npm run lint
- npm run test:unit -- --coverage
- - '[[ ! -z "$SAUCE_ACCESS_KEY" ]] && npm run docs || true'
- - '[[ ! -z "$SAUCE_ACCESS_KEY" ]] && npm run test:visual || true'
+ # if SauceLabs variables are defined, build docs and run visual regression tests
+ - 'if [ -z "$SAUCE_ACCESS_KEY" ]; then true; else npm run docs; fi'
+ - 'if [ -z "$SAUCE_ACCESS_KEY" ]; then true; else npm run test:visual; fi'
after_success:
# Upload code coverage to Codecov
- bash <(curl -s https://codecov.io/bash)
# Upload screenshots to Argos
- - '[[ ! -z "$ARGOS_TOKEN" ]] && argos upload test/screenshots/local -C $TRAVIS_COMMIT -B $TRAVIS_BRANCH -T $ARGOS_TOKEN || true'
+ - 'if [ -z "$ARGOS_TOKEN" ]; then true; else argos upload test/screenshots/local -c "$travis_commit" -b "$travis_branch" -t "$ARGOS_TOKEN"; fi'
before_deploy:
- npm run build
