Skip to content
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 2 commits into from Jan 10, 2019
Merged

Set up travis-ci #15

merged 2 commits into from Jan 10, 2019

Conversation

msaraiva
Copy link
Member

@msaraiva msaraiva commented Jan 7, 2019

No description provided.

@josevalim josevalim closed this Jan 7, 2019
@josevalim josevalim reopened this Jan 7, 2019
.travis.yml Outdated
language: elixir
sudo: false
script:
- if [ -z "$SKIP_FORMAT_CHECK" ]; then mix format --check-formatted; fi
Copy link
Member

@wojtekmach wojtekmach Jan 7, 2019

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 👌

Copy link
Member

@josevalim josevalim Jan 7, 2019

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.

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

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.

@msaraiva msaraiva merged commit 8332b74 into master Jan 10, 2019
@msaraiva msaraiva deleted the setup-travis-ci branch January 10, 2019 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants