Skip to content

Move CI tests from Travis to GitHub #3889

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 11 commits into from
Nov 19, 2020

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Nov 14, 2020

Proposal for using pipenv:

Goal: Add Pipfile and Pipfile.lock (keeping requirements.txt) and speed up our builds

pipenv is a tool which combines the power of pip and venv. My main goal for using this is only to speed up our builds. Why? Take a look at: https://github.com/dhruvmanila/algorithms-keeper/runs/1394249008?check_suite_focus=true. The entire virtual environment directory is cached and so we just skip the installing part which saves approximately 60 seconds in every run.

What happens if we update our dependencies?

The cache works based on a key and the key will depend on one of the dependency file which in this case can be Pipfile or Pipfile.lock (lock file is preferable). When we update any dependency, we update the lock file which means the key will change and thus the cache won't be found. In this case, the virtual environment will be created and cached again, thus updating the cache.

@cclauss Please take a look at the proposal and if there are any doubts, do ask. DO NOT MERGE this PR yet.

Move CI tests to GitHub Actions

Describe your change:

  • Test changes

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.

@dhruvmanila dhruvmanila requested a review from cclauss as a code owner November 14, 2020 05:25
@dhruvmanila dhruvmanila marked this pull request as draft November 14, 2020 05:27
@dhruvmanila dhruvmanila added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files labels Nov 14, 2020
@cclauss
Copy link
Member

cclauss commented Nov 14, 2020

I am not a fan of pipenv... Pining dependencies are for projects that need reliable builds on a rigidly fixed set of dependencies. This is for production software than is heavily supported and must not break.

I much prefer our dependencies to float, to always be the latest-and-greatest. Locking in pined dependencies runs contrary to that goal. If a new release of Python or one of our dependencies breaks our algorithms, I would like to know that as soon as our continuous integration is run.

So, I am OK using pipenv if we never put version numbers in Pipfile but if we need to manually add/change version numbers in that file, then I would be interested to avoid it.

@dhruvmanila
Copy link
Member Author

dhruvmanila commented Nov 14, 2020

To avoid using version numbers, we just put an asterisk symbol like so: numpy = "*" but if that is the case then I should say that we will have to manually update the lock file using the command pipenv lock or we could just avoid the lock file and get every information from the Pipfile itself.

We will just add the Pipfile file and use that to install and update all our dependencies.

Do you want to try this in a new branch?

@cclauss
Copy link
Member

cclauss commented Nov 14, 2020

What if we continue to use requirements.txt and trust the cache if $(pip freeze) does not change.

@dhruvmanila
Copy link
Member Author

There's nothing to worry about if we are using requirements.txt as we will just be using pip to install the dependencies.

If that is the case then please take a look at the workflow file in this PR which is basically a mirror of Travis configuration except for the Travis Buddy notification part which I think I can incorporate into our bot. Only if it ever gets accepted 😕

@dhruvmanila dhruvmanila removed the awaiting reviews This PR is ready to be reviewed label Nov 14, 2020
Copy link
Contributor

@amaank404 amaank404 left a comment

Choose a reason for hiding this comment

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

Awesome 😄

@dhruvmanila dhruvmanila marked this pull request as ready for review November 15, 2020 15:34
@dhruvmanila dhruvmanila changed the title Move build tests from Travis to GitHub Move CI tests from Travis to GitHub Nov 19, 2020
@dhruvmanila dhruvmanila added the awaiting reviews This PR is ready to be reviewed label Nov 19, 2020
@dhruvmanila
Copy link
Member Author

@cclauss this seems good to go, can you take a quick look at the changes?

Co-authored-by: Christian Clauss <cclauss@me.com>
Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

Nice!!

@dhruvmanila dhruvmanila removed the awaiting reviews This PR is ready to be reviewed label Nov 19, 2020
@dhruvmanila dhruvmanila merged commit b9b7fff into TheAlgorithms:master Nov 19, 2020
@dhruvmanila dhruvmanila deleted the travis-to-gh-actions branch November 19, 2020 16:32
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Add initial support for moving tests to GitHub

* Add setup Python step in the workflow

* Remove Travis CI config file

* Fix GitHub action file for build to trigger on PR

* Use Python 3.8 as tensorflow is not yet supported

* Fix ciphers.hill_cipher doctest error

* Fix: instagram crawler tests failing on GitHub actions

* Fix floating point errors in doctest

* Small change to test cache

* Apply suggestions from code review

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update instagram_crawler.py

Co-authored-by: Christian Clauss <cclauss@me.com>
peRFectBeliever pushed a commit to peRFectBeliever/Python that referenced this pull request Apr 1, 2021
* Add initial support for moving tests to GitHub

* Add setup Python step in the workflow

* Remove Travis CI config file

* Fix GitHub action file for build to trigger on PR

* Use Python 3.8 as tensorflow is not yet supported

* Fix ciphers.hill_cipher doctest error

* Fix: instagram crawler tests failing on GitHub actions

* Fix floating point errors in doctest

* Small change to test cache

* Apply suggestions from code review

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update instagram_crawler.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Panquesito7 pushed a commit to Panquesito7/Python that referenced this pull request May 13, 2021
* Add initial support for moving tests to GitHub

* Add setup Python step in the workflow

* Remove Travis CI config file

* Fix GitHub action file for build to trigger on PR

* Use Python 3.8 as tensorflow is not yet supported

* Fix ciphers.hill_cipher doctest error

* Fix: instagram crawler tests failing on GitHub actions

* Fix floating point errors in doctest

* Small change to test cache

* Apply suggestions from code review

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update instagram_crawler.py

Co-authored-by: Christian Clauss <cclauss@me.com>
shermanhui pushed a commit to shermanhui/Python that referenced this pull request Oct 22, 2021
* Add initial support for moving tests to GitHub

* Add setup Python step in the workflow

* Remove Travis CI config file

* Fix GitHub action file for build to trigger on PR

* Use Python 3.8 as tensorflow is not yet supported

* Fix ciphers.hill_cipher doctest error

* Fix: instagram crawler tests failing on GitHub actions

* Fix floating point errors in doctest

* Small change to test cache

* Apply suggestions from code review

Co-authored-by: Christian Clauss <cclauss@me.com>

* Update instagram_crawler.py

Co-authored-by: Christian Clauss <cclauss@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants