Skip to content

Commit

Permalink
[config] Update CI matrix for latest releases
Browse files Browse the repository at this point in the history
* Add Elixir 1.12 to matrix with OTP 22-24
* use `shfmt` to format shell script file
  • Loading branch information
cpjolicoeur committed Jun 22, 2021
1 parent dfe6b10 commit 10c5975
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 23 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ jobs:
otp: 23.2.7
warnings_as_errors: true
static_analysis: false
- elixir: 1.12.x
otp: 22.x
- elixir: 1.12.x
otp: 23.x
- elixir: 1.12.x
otp: 24.x

services:
db:
Expand All @@ -59,6 +65,8 @@ jobs:
DATABASE_POSTGRESQL_USERNAME: postgres
PGHOST: postgres
PGUSER: postgres
TORCH_OTP_VERSION: ${{matrix.otp}}
TORCH_IEX_VERSION: ${{matrix.elixir}}

steps:
- uses: actions/checkout@v2
Expand Down
84 changes: 61 additions & 23 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,81 @@
TEST_ROOT="$(pwd)/test"
ASSETS_ROOT="$(pwd)/assets"

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; }

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
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
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 JS assets lint checks
cd "$ASSETS_ROOT" && {
npm install || { echo 'NPM install failed!'; exit 1; }
npm install || {
echo 'NPM install failed!'
exit 1
}
}
cd "$ASSETS_ROOT" && {
npm run test || { echo 'NPM test failed!'; exit 1; }
npm run test || {
echo 'NPM test failed!'
exit 1
}
}

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

semverPattern='1\.([0-9]+)\.[0-9]+'
[[ $TORCH_IEX_VERSION =~ $semverPattern ]]
minorVersion=${#BASH_REMATCH[1]}
if [ $minorVersion -lt 12 ]; then
cd "$TEST_ROOT/support/apps/phx1_3" && {
bin/test || {
echo 'Integration tests on regular Phoenix 1.3 project failed!'
exit 1
}
}
fi

cd "$TEST_ROOT/support/apps/phx1_4" && {
bin/test || { echo 'Integration tests on regular Phoenix 1.4 project failed!'; exit 1; }
bin/test || {
echo 'Integration tests on regular Phoenix 1.4 project failed!'
exit 1
}
}

cd "$TEST_ROOT/support/apps/phx1_5" && {
bin/test || { echo 'Integration tests on regular Phoenix 1.5 project failed!'; exit 1; }
bin/test || {
echo 'Integration tests on regular Phoenix 1.5 project failed!'
exit 1
}
}

0 comments on commit 10c5975

Please sign in to comment.