knbarton / ners570-finalproject

Ners 570 Final Project
1 stars 1 forks source link

Add Travis CI integration #1

Closed littlewatkins closed 3 years ago

littlewatkins commented 3 years ago

Issue

One of the project goals is to integrate Travis CI into our GitHub repo. This is the tutorial page for doing that.

I will add the Travis CI integration to my fork of this repo, and then @knbarton you will need to do the CI activation for this repo.

littlewatkins commented 3 years ago

Travis CI apparently doesn't have a native Fortran language. But I bet we can get around this with make files.

For now, I'll set the language as python since we want to have python visualization.

knbarton commented 3 years ago

Thanks for working on this! I think setting the language to python is a good idea. I've seen other Fortran projects where everything is run from a Python wrapper script, so maybe we could do the same thing here. I'll go ahead and do the merge for the pull request.

littlewatkins commented 3 years ago

I haven't done anything with python wrappers before, but I think that could be a cool way to do this. Makes more sense than probably creating a data file or something and reading that into python.

As far as the Travis CI, I think you have to authorize the account for this repo (and you may have already done that). If not, the process is quick and the instructions are in the link at the start of the issue.

knbarton commented 3 years ago

For the python wrappers, what I've seen is really similar to a batch script, but in Python. The makefile compiles all the code, and the Python script just calls the compiled code with whatever inputs you want. I can try to find an example, but it's relatively simple. It's a nice way to have the main code and the post-processing plots to be done with just one command.

I think I just got it set up with Travis CI, but I don't see any tests yet (probably because I merged it too soon). I'll try to change the file slightly and do another pull request to see what happens.

knbarton commented 3 years ago

I created a new branch and the Travis CI tests are working on it. I think we need to pull something into main before it will do tests on the main branch, but I don't think this test branch needs to be the one pulled in. I would just wait until we have a branch with useful changes to pull in.

littlewatkins commented 3 years ago

Cool sounds good!

I'll look into adding a badge to the repository for a successful Travis CI build. Not exactly sure if Travis CI tests the main branch? I'm assuming it does haha. But then again if it's testing the development branch and that passes, then once merged, the main branch should pass too.

littlewatkins commented 3 years ago

Ok I added the badge. Currently it says unknown because it's linked to the main branch. Still need to figure out how to make the main branch tested.

Spoke too soon haha. It's working! Here's the link I used to find out how to do that.

littlewatkins commented 3 years ago

Travis CI is running successfully on the branches