MassimoCimmino / pygfunction

An open-source toolbox for the evaluation of thermal response factors (g-functions) of geothermal borehole fields.
BSD 3-Clause "New" or "Revised" License
46 stars 21 forks source link

Automated testing using tox and continuous integration #180

Closed MassimoCimmino closed 2 years ago

MassimoCimmino commented 2 years ago

This issue is to configure tox to automate the execution of tests into fresh Python environments, and to configure github actions for continuous integration re-configure continuous integration.

This issue follows #179.

j-c-cook commented 2 years ago

My only hesitation here is that Github is going to give you a set amount of included minutes, and after that it will be turned off. The goal is for Github to incentivize users to give them money. On private repositories I set up runners and the testing is done on my own machines. For a repository that is open source, someone could place a bug on your machine by opening a pull request. I've considered setting up a virtual environment (possibly cross platform) so that on a rare occasion that some hacker does create a PR that it only corrupts the virtual environment.

MassimoCimmino commented 2 years ago

This is a very good point. GitHub actions seemed like a good idea but really any tool could do the job.

The Travis ci for pygfunction is currently inactive and that is what really needs to be fixed. I'll update the issue. Thanks.

j-c-cook commented 2 years ago

I do like using GitHub actions because the tests are integrated into the pull request confirmation. I am only familiar with using runners (Github and Gitlab), and not familiar with Travis. Following public release of ghedt (currently expected early next year) I plan on setting up a hypervisor (specifically the open source VirtualBox) on my PC. With VirtualBox I will be able to allocate resources to virtual machines running Windows, Linux and possibly Mac OS. I plan for these virtual machines to have CI/CD runners installed as servers to perform tests on ghedt pull requests. Github only limits computing time if it is done on their machines, not if it is done locally with runners.

Given that I can make what is described above work, I wouldn't mind also hosting the tests for pygfunction on those virtual machines. I believe I have adequate computing resources to handle tests for both ghedt and pygfunction. We'd need to coordinate some things as that got closer, if you'd be interested in the option described here.

MassimoCimmino commented 2 years ago

It seems simple enough to configure github-actions that I am willing to try it out.

We can see how far 3000 min/month goes and reconsider later. With the current pace of development, pygfunction might not need much.

MassimoCimmino commented 2 years ago

I am re-opening this issue as I realized that Github Actions is free for public repositories.

I initially only included tests on ubuntu on PR events to the master branch, but we can extend to also test on windows.