New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up travis-ci #15
Set up travis-ci #15
Conversation
.travis.yml
Outdated
language: elixir | ||
sudo: false | ||
script: | ||
- if [ -z "$SKIP_FORMAT_CHECK" ]; then mix format --check-formatted; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recently on MyXQL I added another check, to fail the build if there are warnings mix compile --warnings-as-errors
, so consider adding that too. I also did it a bit differently but I've probably overcomplicated it a bit (ci.sh
).
Instead of by default running formatter and skipping it sometimes, consider skipping formatter by default and running it sometimes. In case we'd ever run against different Elixir versions, I think we'd prefer to run the formatter against the latest only.
Btw, comparing approaches, I just thought about something. I'll probably do the following to MyXQL :)
language: elixir
sudo: false
matrix:
include:
- elixir: 1.5.3
otp_release: 18.3
- elixir: 1.7.4
otp_release: 21.2
before_script:
- mix format --check-formatted
All that being said, keeping this as is sounds great 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of by default running formatter and skipping it sometimes, consider skipping formatter by default and running it sometimes. In case we'd ever run against different Elixir versions, I think we'd prefer to run the formatter against the latest only.
Agreed. We should run the formatter just once and always on latest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like before_script
doesn't work at this level:
in matrix.include section: unexpected key before_script, dropping
I think I'll have to stick with env
, however I could change it to CHECK_FORMAT=true
so I could set it only on the latest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! I ended up using script:
in that matrix step in MyXQL (which means it's gonna run just checks instead of tests which I'm fine with). Yup, using simply env is fine, it has the nice benefit that ENV shows up in Travis job description so it's easier to spot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the ENV but let's reverse it. Let's run the formatter ONLY IF the environment variable is set. I think that's a better behaviour because the formatter may behave different between Elixir version. So we want to indeed run in only one of them.
No description provided.