souramoo / commentoplusplus

Commento with out of the box patches and updates to add useful features and fixes. Also with one-click deploy to Heroku so you can get up and running fast.
MIT License
389 stars 62 forks source link

Add build and test GitHub Workflow based on the GitLab CI #84

Closed olof-nord closed 2 years ago

olof-nord commented 2 years ago

The Build and Test are executed on all git commits except for master commits or any git tag pushes.

I understand this as the equivalent of the following GitLab CI.

go-test:
  except:
    - master
    - tags
olof-nord commented 2 years ago

The main benefit of orchestrating the build and test jobs is to set go and node.js version in one place - having a file workflows in a folder workflows could perhaps be improved. Not sure what is a good name

olof-nord commented 2 years ago

Reading here as well as looking into the gitlab CI, perhaps we need to set up the DB before we can execute the tests.

https://docs.commento.io/contributing/running-tests.html

olof-nord commented 2 years ago

As the tests do not compile yet, I opened issue #93 and include them but disabled for now.

souramoo commented 2 years ago

Thank you very much for doing all of this! I am quite keen to merge this in and get rid of the other CI platforms configured.

I think we want to modify this so it does run on all branches including main and tagged branches, and so that it can automatically set up compiled releases when we tag commits as a release. I am quite keen on tagged releases automatically deploying a docker image too.

I have fixed the tests in the main repo, and yes we need to add a database server for the tests to work in the github actions workflow. The original one did this by adding a postgre docker thing (see https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers for how we might do this in github).

souramoo commented 2 years ago

Added and fixed the tests with the postgre database - CI is now functional!