Skip to content

Commit

Permalink
Merge pull request #109 from danielberkompas/cpj/travis_coveralls_config
Browse files Browse the repository at this point in the history
[test] Configure coveralls for TravisCI
  • Loading branch information
cpjolicoeur committed Sep 12, 2019
2 parents 0037052 + f0217da commit 8bb1a64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -13,4 +13,4 @@ script:
before_script:
- psql -c 'create database example_test;' -U postgres
env:
- DATABASE_POSTGRESQL_USERNAME=postgres
- MIX_ENV=test DATABASE_POSTGRESQL_USERNAME=postgres
1 change: 1 addition & 0 deletions README.md
@@ -1,5 +1,6 @@
[![Hex.pm](https://img.shields.io/hexpm/v/torch.svg)](https://hex.pm/packages/torch)
[![Build Status](https://travis-ci.org/danielberkompas/torch.svg?branch=master)](https://travis-ci.org/danielberkompas/torch)
[![Coverage Status](https://coveralls.io/repos/github/danielberkompas/torch/badge.svg?branch=master)](https://coveralls.io/github/danielberkompas/torch?branch=master)

<p align="center">
<img width="489" alt="phoenix_torch_logo" src="https://user-images.githubusercontent.com/7085617/37124853-ef17cec8-221e-11e8-97b9-bb6d13188500.png">
Expand Down
17 changes: 13 additions & 4 deletions bin/test
Expand Up @@ -3,14 +3,23 @@
MIX_ENV=test mix compile --warnings-as-errors --force || { echo 'Please fix all compiler warnings.'; exit 1; }
MIX_ENV=test mix credo --strict --ignore design,consistency || { echo 'Elixir code failed Credo linting. See warnings above.'; exit 1; }
MIX_ENV=test mix docs || { echo 'Elixir HTML docs were not generated!'; exit 1; }
MIX_ENV=test mix test || { echo 'Elixir tests on Torch failed!'; exit 1; }

if [ $CI ]; then
mix coveralls || { echo 'Elixir tests on Torch failed!'; exit 1; }
else
mix test || { echo 'Elixir tests on Torch failed!'; exit 1; }
if [ $TRAVIS ]; then
echo "----------------------------------------------------------"
echo "Running coveralls.travis..."
echo "----------------------------------------------------------"
mix coveralls.travis || { echo 'Elixir coverage on Torch failed!'; exit 1; }
else
echo "----------------------------------------------------------"
echo "Running coveralls..."
echo "----------------------------------------------------------"
mix coveralls || { echo 'Elixir coverage on Torch failed!'; exit 1; }
fi
fi

# Run integration tests
cd test/support/apps/example && {
bin/test || { echo 'Integration tests on regular Phoenix project failed!'; exit 1; }
}
}

0 comments on commit 8bb1a64

Please sign in to comment.