open-contracting / data-registry

BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Set up GitHub Actions #11

Closed jpmckinney closed 3 years ago

jpmckinney commented 3 years ago

As a Django project, this can copy the workflows from one of toucan, kingfisher-process (django branch), cove-ocds, cove-oc4ids, etc. I've enabled Coveralls, so Coveralls reporting should just work once CI is set up.

Also, please add a readme with the badges for CI and Coveralls.

jakubkrafka commented 3 years ago

Deployed and fixed. However, I had to hack few issues in dependency checks (test_requirements.py).

  1. if there is a config file called test.py and dependency is used only there, the _testrequirements.py skips such a file and reports dependency as not used at all. Fixed by renaming the test file to github.py.
  2. psycopg2-binary - the dependency is used in a configuration manner (Django DB connection), not imported directly. Fixed by fake import. This can be maybe avoided by dj_database_url, but I'm not such a big fan of that.
jpmckinney commented 3 years ago

@jakubkrafka Is there a reason the config file starts with test? This can also confuse test runners.

For psycopg2-binary, you can change the command to run with STANDARD_MAINTENANCE_SCRIPTS_IGNORE=psycopg2 pytest /tmp/test_requirements.py

In test_requirements.py, we already look in configurations for INSTALLED_APPS, etc. so I can also update it so that STANDARD_MAINTENANCE_SCRIPTS_IGNORE is not needed in future.

jpmckinney commented 3 years ago

Aha, test.py was a settings file for the CI environment. I guess github.py is fine, or ci.py.

jpmckinney commented 3 years ago

I improved the test in https://github.com/open-contracting/standard-maintenance-scripts/commit/11f159009fe151e70905e87a026a34d014b7bab1

jakubkrafka commented 3 years ago

Thanks for the script update! I've considered the ignore as well, but didn't like it in the end. The test for such a crucial component should be present. B

jakubkrafka commented 3 years ago

Added vue CI to the process as well.