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
Merged
Merged
Set up travis-ci #15
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: elixir | ||
sudo: false | ||
script: | ||
- if [ -z "$SKIP_FORMAT_CHECK" ]; then mix format --check-formatted; fi | ||
- mix test | ||
matrix: | ||
include: | ||
- elixir: 1.5.3 | ||
otp_release: 18.3 | ||
env: SKIP_FORMAT_CHECK=true | ||
- elixir: 1.7.4 | ||
otp_release: 21.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 :)
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.
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:I think I'll have to stick with
env
, however I could change it toCHECK_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.