Skip to content

Add OSX builds and refactor TravisCI build config #317

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

Merged
merged 14 commits into from
Jan 17, 2019
Merged

Conversation

leouieda
Copy link
Member

@leouieda leouieda commented Jan 16, 2019

Refactor the TravisCI build configuration to make it easier to add OSX support
and to deploy the docs to Github pages later on. Set different builds in the
matrix for cron jobs and separate testing and building the docs. This is
necessary since the tests are known to always fail and we want to deploy the
docs anyway. The build was always passing even if the docs or tests ended in
failure because the cd build; ...; cd..; command always passes. The return
value is only taken from the last cd.

Replaces the apt-get command with the apt addon.
Make the build matrix more explicit. Only check if it's a cron job when
setting the variables for build actions. This way, we can overwrite that
to run full builds by setting those variables to "true".

Rename the build scripts to more descriptive names.
Avoid downloading and installing miniconda.
Testing is known to be failing so use a different job to build and
deploy docs.
@leouieda leouieda changed the title WIP Reform the Travis builds WIP Refactor the TravisCI build configuration Jan 17, 2019
@leouieda leouieda changed the title WIP Refactor the TravisCI build configuration WIP Add OSX builds and refactor TravisCI build configuration Jan 17, 2019
@leouieda leouieda changed the title WIP Add OSX builds and refactor TravisCI build configuration WIP Add OSX builds and refactor TravisCI build config Jan 17, 2019
@leouieda
Copy link
Member Author

I think I managed to get a simpler setup than #146 and the build time for OSX is 7.5 min. Even then, we always have the option of ignoring the CI (though we shouldn't).

Running a last test to see if the build works on the cron jobs as well.

.travis.yml Outdated
- name: "Mac"
os: osx
if: type != cron
- name: "Max"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Max -> Mac

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

set (DCW_ROOT "$ENV{COASTLINEDIR}")
set (GSHHG_ROOT "$ENV{COASTLINEDIR}")

set (CMAKE_BUILD_TYPE Debug)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate CMAKE_BUILD_TYPE if "COVERAGE" == "true".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 removed the one inside the if block

.travis.yml Outdated
- cd ..

# Things to do if the build is successful
after_success:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although some tests fail, we can still upload coverage reports.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I forgot about that. At least now the tests really show up as failures instead of passing. Hopefully that red badge will be good motivation to fix them or mark as won't fix 😉

@leouieda leouieda requested a review from seisman January 17, 2019 10:56
@leouieda leouieda changed the title WIP Add OSX builds and refactor TravisCI build config Add OSX builds and refactor TravisCI build config Jan 17, 2019
@leouieda
Copy link
Member Author

@seisman should be good to go. Could you do one last review?

.travis.yml Outdated
export CONDA_INSTALL_EXTRA="sphinx"
export COVERAGE=true
fi
- COVERAGE=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable COVERAGE seems useless, since we always need to run the tests to generate coverage reports.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree. I'll remove it and use the TEST variable instead.

cat >> cmake/ConfigUser.cmake << 'EOF'
set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement -coverage -O0")
EOF
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to enable the tests in compile-only jobs, so we can change it to:

if [ "$TEST" == "all"]; then
    cat >> cmake/ConfigUser.cmake << 'EOF'
set (CMAKE_BUILD_TYPE Debug)
enable_testing()
set (DO_EXAMPLES TRUE)
set (DO_TESTS TRUE)
set (DO_ANIMATIONS TRUE)
set (N_TEST_JOBS 2)
set (CMAKE_C_FLAGS "-Wall -Wdeclaration-after-statement -coverage -O0")
EOF
fi   

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any of those required for building the docs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, already found it.

@seisman
Copy link
Member

seisman commented Jan 17, 2019

@leouieda The PR looks good. I just made two comments.

@seisman
Copy link
Member

seisman commented Jan 17, 2019

@leouieda codecov needs a token to upload the coverage reports. The token was added via the travis settings panel. You can encrypt this token and add it to .travis.yml.

@leouieda
Copy link
Member Author

@leouieda codecov needs a token to upload the coverage reports. The token was added via the travis settings panel. You can encrypt this token and add it to .travis.yml.

No need. Plus, I can't access the unencrypted token from the web interface.

@leouieda leouieda merged commit 4f8c210 into master Jan 17, 2019
@leouieda leouieda deleted the travis-osx-take-2 branch January 17, 2019 20:01
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.

2 participants