RSE-Sheffield / sheffield-covid-19

Scrape COVID-19 data from the University website
1 stars 8 forks source link

There is no continuous integration #8

Closed drj11 closed 3 years ago

drj11 commented 3 years ago

Adding a Travis configuration file would be good.

If someone wants to try their hand at other Continuous Integration providers, that would be okay too!

midhun1998 commented 3 years ago

Hi @drj11 . I'm new to CI and would like to learn and implement this. Can I take up this issue, please?

drj11 commented 3 years ago

Sounds good to me, but since you've already got a PR in, do you fancy leaving it for a couple of days to see if anyone else wants to try it?

If you've already started it, i'm not going to turn a PR away. :)

midhun1998 commented 3 years ago

Yeah i totally understand @drj11 and I'm okay with leaving it for couple of days. No I haven't started as I'm still learning it. 😄

drj11 commented 3 years ago

go for it!

drj11 commented 3 years ago

Do you need any pointers?

midhun1998 commented 3 years ago

Thanks for assigning @drj11 . Yeah could you please brief on or give nme an overall idea on how exactly you want me to integrate. If you can please share few resources which could guide me right direction. Will really appreciate your help. 🙂

drj11 commented 3 years ago

Sure.

So the idea is to add Travis CI . Other Continuous Integration's are available, but Travis is well known. If anyone wants to add another CI, that would be okay too!

The way this (and other CI) works is by adding a particular file called .travis.yml to the top-level of the repo.

The Travis tutorial is here: https://docs.travis-ci.com/user/tutorial/

The Python specific stuff is here: https://docs.travis-ci.com/user/languages/python/

(it is possible that I need to activate Travis for this repo, i'll look into that after writing this comment)

For Python versions, we ought to use all current supported versions of Python, which is 3.6, 3.7, 3.8, 3.9. But really given that 3.6 is old now, and 3.9 has only just been made public, it would be okay to avoid those.

Since there are no tests yet (see issue #9 ) the CI script can't run the tests. It should run the code/ingest.py script. If that script runs to completion without an Exception then that's fine. An Exception in that script will cause the program to exit with a non-0 status code, which will cause Travis to mark the build as failing; that's what we want.

midhun1998 commented 3 years ago

Hi @drj11 . I have tested for build success and failure. Opening PR. Kindly review and let me know any changes if needed. Thanks.