byroot / activerecord-typedstore

ActiveRecord::Store but with type definition
MIT License
441 stars 57 forks source link

Switch travis.yml to Github actions #84

Closed adrianna-chang-shopify closed 3 years ago

adrianna-chang-shopify commented 3 years ago

Move CI build from Travis to GitHub actions

I've changed the ruby versions to test 2.6 and 2.7 now that the main branch for Rails requires ruby-2.7 to work.

Étienne and I wrestled with trying to get PostgresQL working properly, without needing to create a separate service container (since it comes out of the box with the Ubuntu VM). We were constantly running into the error FATAL: Peer authentication failed for user "postgres" though. psql doesn't allow you to specify a password through the CLI, and even exporting it as an env var (PGPASSWORD=postgres) wouldn't work.

We found this action figured out how to start psql in the VM. Notably, it specifies swaps using md5 auth for trust, and then creates a superuser and a new db that we can connect to from the tests. I've borrowed the steps from this action and added them to a single step in our workflow so that we don't have this external dependency.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.6%) to 98.331% when pulling 8609972ff880bc6792cebbb8304838cdd1c21750 on adrianna-chang-shopify:gh-actions into 13a54e9d2e2591ca031c0c8607009cd133c63a27 on byroot:master.

casperisfine commented 3 years ago

without needing to create a separate service container

Honestly that would have been fine to use an external container, and probably more resilient to changes, as ubuntu-latest is a moving target, so future ubuntu upgrades might break our CI.

But looks fine for now so I'll merge.