Class: Gemika::GithubActionsGenerator
- Inherits:
-
Object
- Object
- Gemika::GithubActionsGenerator
- Defined in:
- lib/gemika/github_actions_generator.rb
Constant Summary collapse
- TYPES =
{ test_sqlite: { gemfile_filter: /\.sqlite/, }, test_pg: { gemfile_filter: /\.pg/, database_setup: [ 'sudo apt-get install -y postgresql-client', "PGPASSWORD=postgres psql -c 'create database test;' -U postgres -p 5432 -h localhost", ], services: { 'postgres' => { 'image' => 'postgres', 'env' => { 'POSTGRES_PASSWORD' => 'postgres' }, 'options' => '--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5', 'ports' => ['5432:5432'], }, }, }, test_mysql: { gemfile_filter: /\.mysql/, database_setup: [ 'sudo apt-get install -y mysql-client libmariadbclient-dev', "mysql -e 'create database IF NOT EXISTS test;' -u root --password=password -P 3306 -h 127.0.0.1", ], services: { 'mysql' => { 'image' => 'mysql:5.6', 'env' => { 'MYSQL_ROOT_PASSWORD' => 'password', }, 'options' => '--health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 5', 'ports' => ['3306:3306'], }, }, }, test: { gemfile_filter: //, } }
Instance Method Summary collapse
- #generate(rows) ⇒ Object
-
#initialize(bundler_version:) ⇒ GithubActionsGenerator
constructor
A new instance of GithubActionsGenerator.
Constructor Details
#initialize(bundler_version:) ⇒ GithubActionsGenerator
Returns a new instance of GithubActionsGenerator.
46 47 48 |
# File 'lib/gemika/github_actions_generator.rb', line 46 def initialize(bundler_version:) @bundler_version = bundler_version end |
Instance Method Details
#generate(rows) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/gemika/github_actions_generator.rb', line 50 def generate(rows) rows_by_type = split_rows_by_gemfile(rows) jobs = {} rows_by_type.each do |type, type_rows| jobs[type.to_s] = job_by_type(type, type_rows) end full_config(jobs) end |