GitHub Actions CI config for MySQL, Redis, Elasticsearch in Ruby on Rails project with RSpec tests. How to run parallel tests with Github Actions jobs for Rails project with MySQL, Redis, Elasticsearch. How to configure Ruby on Rails project on GitHub Actions.
You will learn how to configure Ruby on Rails project on GitHub Actions. This specific Rails project has MySQL and Redis database. There is also Elasticsearch service running on CI. If your project is close to that setup below GitHub Actions yaml configuration will allow you to run tests on GitHub CI server.
If you happen to use PostgreSQL you can check our previous article about Rails app configuration with Postgres on GitHub Actions.
In your repository, you need to create file
.github/workflows/main.yaml. Thanks to it GitHub Actions will run your CI builds. You can find results of executed CI builds in Actions tab on your GitHub repository page.
In this case, Rails application has MySQL, Redis, and Elasticsearch databases. You need to set up services with docker container to run each. In the below config, there is also a step for health check the MySQL and Elasticsearch to ensure both are up and running before you can start running tests.
Compare ScaleGrid MySQL vs. DigitalOcean Managed Databases - See which offers the best MySQL throughput, latency, and pricing on DigitalOcean across workloads.
Setup Ruby on Github Actions to cache Ruby gems for Rails project. How to start CI build faster by loading Ruby gems from cache on Github Actions? You can start running your tests for a Ruby on Rails project quicker if you manage to set up all dependencies in a short amount of time.
Github Actions auto split of slow RSpec test file in parallel jobs for Ruby on Rails project. Consider the split · Divide and conquer · Enter split by test. How to run slow RSpec test files on Github Actions with parallel jobs by doing an auto split of the spec file by test examples.
Redis Lua scripting is the popularly recommended approach for handling transactions. Learn the common Lua Scripts error and how to handle for sentinel systems. Redis offers two mechanisms for handling transactions – MULTI/EXEC based transactions and Lua scripts evaluation. Redis Lua scripting is the recommended approach and is fairly popular in usage.
Deploying my portfolio website on Github Pages using Github Actions. I recently deployed my portfolio site and wanted to try out github actions and this is my experience of automating the deployment.