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.

GitHub Actions configuration for Rails

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 MySQLRedis, 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.

#github #github-actions #redis #mysql #elasticsearch #ruby

GitHub Actions CI config for MySQL, Redis, Elasticsearch in Ruby on Rails project
3.70 GEEK