From f132c1bcb5d69f162bfb94235e27528692b98bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Thu, 31 Aug 2023 12:12:45 +0200 Subject: [PATCH] Make env variable from each matrix key automatically Renamed a few of them to follow convention. --- .github/workflows/aggregate_root.yml | 6 ++- .github/workflows/aggregate_root_coverage.yml | 1 - .github/workflows/dres_client.yml | 3 +- .github/workflows/dres_rails.yml | 6 ++- .../workflows/minitest-ruby_event_store.yml | 6 ++- .../minitest-ruby_event_store_coverage.yml | 3 +- .github/workflows/rails_event_store.yml | 6 ++- .../workflows/rails_event_store_coverage.yml | 1 - .../ruby_event_store-active_record.yml | 12 +++-- ...uby_event_store-active_record_coverage.yml | 1 - .../workflows/ruby_event_store-browser.yml | 6 ++- .../ruby_event_store-browser_coverage.yml | 1 - .../workflows/ruby_event_store-flipper.yml | 6 ++- .../ruby_event_store-flipper_coverage.yml | 1 - .../workflows/ruby_event_store-newrelic.yml | 6 ++- .../ruby_event_store-newrelic_coverage.yml | 1 - .github/workflows/ruby_event_store-outbox.yml | 9 ++-- .../ruby_event_store-outbox_coverage.yml | 1 - .../workflows/ruby_event_store-profiler.yml | 6 ++- .../ruby_event_store-profiler_coverage.yml | 1 - .../workflows/ruby_event_store-protobuf.yml | 9 ++-- .../ruby_event_store-protobuf_coverage.yml | 1 - .github/workflows/ruby_event_store-rom.yml | 12 +++-- .../ruby_event_store-rom_coverage.yml | 1 - .github/workflows/ruby_event_store-rspec.yml | 6 ++- .../ruby_event_store-rspec_coverage.yml | 1 - .github/workflows/ruby_event_store-sequel.yml | 12 +++-- .../ruby_event_store-sequel_coverage.yml | 1 - .../ruby_event_store-sidekiq_scheduler.yml | 8 ++-- ...event_store-sidekiq_scheduler_coverage.yml | 2 - .../ruby_event_store-transformations.yml | 6 ++- ...y_event_store-transformations_coverage.yml | 1 - .github/workflows/ruby_event_store.yml | 6 ++- .../workflows/ruby_event_store_coverage.yml | 1 - support/ci/assets.yaml.erb | 2 +- support/ci/contrib.yaml.erb | 6 +-- support/ci/coverage.yaml.erb | 3 +- support/ci/db.yaml.erb | 8 +--- support/ci/dres_client.yaml.erb | 3 +- support/ci/dres_rails.yaml.erb | 4 +- support/ci/elm.yaml.erb | 6 +-- support/ci/generate | 47 ++++++++++++++++--- support/ci/outbox.yaml.erb | 7 +-- support/ci/outbox_coverage.yaml.erb | 3 +- support/ci/protobuf.yaml.erb | 7 +-- support/ci/rom.yaml.erb | 8 +--- support/ci/ruby.yaml.erb | 6 +-- support/ci/scheduler.yaml.erb | 8 +--- support/ci/scheduler_coverage.yaml.erb | 4 +- 49 files changed, 150 insertions(+), 122 deletions(-) diff --git a/.github/workflows/aggregate_root.yml b/.github/workflows/aggregate_root.yml index 441eb39bd6..bc6be3f175 100644 --- a/.github/workflows/aggregate_root.yml +++ b/.github/workflows/aggregate_root.yml @@ -18,7 +18,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: aggregate_root - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -49,7 +50,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: aggregate_root - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/aggregate_root_coverage.yml b/.github/workflows/aggregate_root_coverage.yml index 515873da52..154560e0c7 100644 --- a/.github/workflows/aggregate_root_coverage.yml +++ b/.github/workflows/aggregate_root_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: aggregate_root strategy: fail-fast: false diff --git a/.github/workflows/dres_client.yml b/.github/workflows/dres_client.yml index 07e88e5b35..932155a7a6 100644 --- a/.github/workflows/dres_client.yml +++ b/.github/workflows/dres_client.yml @@ -24,7 +24,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/dres_client - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: diff --git a/.github/workflows/dres_rails.yml b/.github/workflows/dres_rails.yml index 459fa1f28f..3704b22677 100644 --- a/.github/workflows/dres_rails.yml +++ b/.github/workflows/dres_rails.yml @@ -24,8 +24,10 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/dres_rails - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" + DATA_TYPE: "${{ matrix.data_type }}" services: postgres_11: image: postgres:11 diff --git a/.github/workflows/minitest-ruby_event_store.yml b/.github/workflows/minitest-ruby_event_store.yml index 364d1d2131..53570f0875 100644 --- a/.github/workflows/minitest-ruby_event_store.yml +++ b/.github/workflows/minitest-ruby_event_store.yml @@ -20,7 +20,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/minitest-ruby_event_store - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -47,7 +48,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/minitest-ruby_event_store - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/minitest-ruby_event_store_coverage.yml b/.github/workflows/minitest-ruby_event_store_coverage.yml index e171a38317..2b1dbb542e 100644 --- a/.github/workflows/minitest-ruby_event_store_coverage.yml +++ b/.github/workflows/minitest-ruby_event_store_coverage.yml @@ -22,8 +22,9 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/minitest-ruby_event_store + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/rails_event_store.yml b/.github/workflows/rails_event_store.yml index e340dcdc35..174d3fca93 100644 --- a/.github/workflows/rails_event_store.yml +++ b/.github/workflows/rails_event_store.yml @@ -18,7 +18,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: rails_event_store - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -53,7 +54,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: rails_event_store - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/rails_event_store_coverage.yml b/.github/workflows/rails_event_store_coverage.yml index fb4d20ddd6..5851cac45a 100644 --- a/.github/workflows/rails_event_store_coverage.yml +++ b/.github/workflows/rails_event_store_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: rails_event_store strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-active_record.yml b/.github/workflows/ruby_event_store-active_record.yml index a07a8763ba..651c62e165 100644 --- a/.github/workflows/ruby_event_store-active_record.yml +++ b/.github/workflows/ruby_event_store-active_record.yml @@ -18,9 +18,10 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store-active_record - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} - DATA_TYPE: ${{ matrix.data_type }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" + DATA_TYPE: "${{ matrix.data_type }}" services: postgres_11: image: postgres:11 @@ -122,7 +123,10 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store-active_record - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" + DATA_TYPE: "${{ matrix.data_type }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-active_record_coverage.yml b/.github/workflows/ruby_event_store-active_record_coverage.yml index c3e0c09f28..cba26997d6 100644 --- a/.github/workflows/ruby_event_store-active_record_coverage.yml +++ b/.github/workflows/ruby_event_store-active_record_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: ruby_event_store-active_record strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-browser.yml b/.github/workflows/ruby_event_store-browser.yml index 7a528d4638..41a5fb8d3f 100644 --- a/.github/workflows/ruby_event_store-browser.yml +++ b/.github/workflows/ruby_event_store-browser.yml @@ -18,7 +18,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store-browser - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -60,7 +61,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store-browser - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-browser_coverage.yml b/.github/workflows/ruby_event_store-browser_coverage.yml index 7f47d4923c..2c49aaba11 100644 --- a/.github/workflows/ruby_event_store-browser_coverage.yml +++ b/.github/workflows/ruby_event_store-browser_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: ruby_event_store-browser strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-flipper.yml b/.github/workflows/ruby_event_store-flipper.yml index 42f9142038..1c6d415601 100644 --- a/.github/workflows/ruby_event_store-flipper.yml +++ b/.github/workflows/ruby_event_store-flipper.yml @@ -20,7 +20,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-flipper - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -53,7 +54,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-flipper - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-flipper_coverage.yml b/.github/workflows/ruby_event_store-flipper_coverage.yml index b50b43a201..be53b169b2 100644 --- a/.github/workflows/ruby_event_store-flipper_coverage.yml +++ b/.github/workflows/ruby_event_store-flipper_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-flipper strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-newrelic.yml b/.github/workflows/ruby_event_store-newrelic.yml index 12bcd4fe60..ec873dd9d8 100644 --- a/.github/workflows/ruby_event_store-newrelic.yml +++ b/.github/workflows/ruby_event_store-newrelic.yml @@ -20,7 +20,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-newrelic - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -49,7 +50,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-newrelic - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-newrelic_coverage.yml b/.github/workflows/ruby_event_store-newrelic_coverage.yml index bea90288f6..ea292607b8 100644 --- a/.github/workflows/ruby_event_store-newrelic_coverage.yml +++ b/.github/workflows/ruby_event_store-newrelic_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-newrelic strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-outbox.yml b/.github/workflows/ruby_event_store-outbox.yml index 7bcd01f6e9..df1609c6ae 100644 --- a/.github/workflows/ruby_event_store-outbox.yml +++ b/.github/workflows/ruby_event_store-outbox.yml @@ -20,8 +20,9 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-outbox - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" services: mysql_5: image: mysql:5 @@ -104,7 +105,9 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-outbox - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-outbox_coverage.yml b/.github/workflows/ruby_event_store-outbox_coverage.yml index 415e63bb95..266232ae96 100644 --- a/.github/workflows/ruby_event_store-outbox_coverage.yml +++ b/.github/workflows/ruby_event_store-outbox_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-outbox strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-profiler.yml b/.github/workflows/ruby_event_store-profiler.yml index 8fb96e571a..7fe9f8f2c9 100644 --- a/.github/workflows/ruby_event_store-profiler.yml +++ b/.github/workflows/ruby_event_store-profiler.yml @@ -20,7 +20,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-profiler - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -49,7 +50,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-profiler - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-profiler_coverage.yml b/.github/workflows/ruby_event_store-profiler_coverage.yml index 8fc6bd94f3..065b32dffe 100644 --- a/.github/workflows/ruby_event_store-profiler_coverage.yml +++ b/.github/workflows/ruby_event_store-profiler_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-profiler strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-protobuf.yml b/.github/workflows/ruby_event_store-protobuf.yml index 2e9bd25521..bbc21eea3f 100644 --- a/.github/workflows/ruby_event_store-protobuf.yml +++ b/.github/workflows/ruby_event_store-protobuf.yml @@ -20,8 +20,9 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-protobuf - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" strategy: fail-fast: false matrix: @@ -63,7 +64,9 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-protobuf - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-protobuf_coverage.yml b/.github/workflows/ruby_event_store-protobuf_coverage.yml index 4fca6e7053..1c43f7ad18 100644 --- a/.github/workflows/ruby_event_store-protobuf_coverage.yml +++ b/.github/workflows/ruby_event_store-protobuf_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-protobuf strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-rom.yml b/.github/workflows/ruby_event_store-rom.yml index 1e64ee2863..9cd568955f 100644 --- a/.github/workflows/ruby_event_store-rom.yml +++ b/.github/workflows/ruby_event_store-rom.yml @@ -20,9 +20,10 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-rom - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} - DATA_TYPE: ${{ matrix.data_type }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" + DATA_TYPE: "${{ matrix.data_type }}" services: postgres_11: image: postgres:11 @@ -112,7 +113,10 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-rom - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" + DATA_TYPE: "${{ matrix.data_type }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-rom_coverage.yml b/.github/workflows/ruby_event_store-rom_coverage.yml index a5271c42e3..4c22f2c224 100644 --- a/.github/workflows/ruby_event_store-rom_coverage.yml +++ b/.github/workflows/ruby_event_store-rom_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-rom strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-rspec.yml b/.github/workflows/ruby_event_store-rspec.yml index b85860eb16..29ac2484db 100644 --- a/.github/workflows/ruby_event_store-rspec.yml +++ b/.github/workflows/ruby_event_store-rspec.yml @@ -18,7 +18,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store-rspec - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -49,7 +50,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store-rspec - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-rspec_coverage.yml b/.github/workflows/ruby_event_store-rspec_coverage.yml index 425f34e770..5acb36d16d 100644 --- a/.github/workflows/ruby_event_store-rspec_coverage.yml +++ b/.github/workflows/ruby_event_store-rspec_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: ruby_event_store-rspec strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-sequel.yml b/.github/workflows/ruby_event_store-sequel.yml index cfdff40d29..1bd4dc3efb 100644 --- a/.github/workflows/ruby_event_store-sequel.yml +++ b/.github/workflows/ruby_event_store-sequel.yml @@ -20,9 +20,10 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-sequel - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} - DATA_TYPE: ${{ matrix.data_type }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" + DATA_TYPE: "${{ matrix.data_type }}" services: postgres_11: image: postgres:11 @@ -112,7 +113,10 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-sequel - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" + DATABASE_URL: "${{ matrix.database_url }}" + DATA_TYPE: "${{ matrix.data_type }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-sequel_coverage.yml b/.github/workflows/ruby_event_store-sequel_coverage.yml index d81aebe353..048bb2dbf9 100644 --- a/.github/workflows/ruby_event_store-sequel_coverage.yml +++ b/.github/workflows/ruby_event_store-sequel_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-sequel strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store-sidekiq_scheduler.yml b/.github/workflows/ruby_event_store-sidekiq_scheduler.yml index 7d75288441..4493903c40 100644 --- a/.github/workflows/ruby_event_store-sidekiq_scheduler.yml +++ b/.github/workflows/ruby_event_store-sidekiq_scheduler.yml @@ -20,8 +20,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-sidekiq_scheduler - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - REDIS_URL: redis://localhost:6379/0 + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -71,8 +71,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-sidekiq_scheduler - BUNDLE_GEMFILE: Gemfile - REDIS_URL: redis://localhost:6379/0 + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-sidekiq_scheduler_coverage.yml b/.github/workflows/ruby_event_store-sidekiq_scheduler_coverage.yml index 63062d9f31..a4c2addb19 100644 --- a/.github/workflows/ruby_event_store-sidekiq_scheduler_coverage.yml +++ b/.github/workflows/ruby_event_store-sidekiq_scheduler_coverage.yml @@ -22,9 +22,7 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-sidekiq_scheduler - REDIS_URL: redis://localhost:6379/0 strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-transformations.yml b/.github/workflows/ruby_event_store-transformations.yml index 427428be1d..01472e6b03 100644 --- a/.github/workflows/ruby_event_store-transformations.yml +++ b/.github/workflows/ruby_event_store-transformations.yml @@ -20,7 +20,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-transformations - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -49,7 +50,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: contrib/ruby_event_store-transformations - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store-transformations_coverage.yml b/.github/workflows/ruby_event_store-transformations_coverage.yml index 512674e81c..d914d2afa2 100644 --- a/.github/workflows/ruby_event_store-transformations_coverage.yml +++ b/.github/workflows/ruby_event_store-transformations_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: contrib/ruby_event_store-transformations strategy: fail-fast: false diff --git a/.github/workflows/ruby_event_store.yml b/.github/workflows/ruby_event_store.yml index 88eafd0cfd..aeac67993b 100644 --- a/.github/workflows/ruby_event_store.yml +++ b/.github/workflows/ruby_event_store.yml @@ -18,7 +18,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false matrix: @@ -49,7 +50,8 @@ jobs: runs-on: ubuntu-20.04 env: WORKING_DIRECTORY: ruby_event_store - BUNDLE_GEMFILE: Gemfile + RUBY_VERSION: "${{ matrix.ruby_version }}" + BUNDLE_GEMFILE: "${{ matrix.bundle_gemfile }}" strategy: fail-fast: false steps: diff --git a/.github/workflows/ruby_event_store_coverage.yml b/.github/workflows/ruby_event_store_coverage.yml index 919539e85c..84dbf29aa5 100644 --- a/.github/workflows/ruby_event_store_coverage.yml +++ b/.github/workflows/ruby_event_store_coverage.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile WORKING_DIRECTORY: ruby_event_store strategy: fail-fast: false diff --git a/support/ci/assets.yaml.erb b/support/ci/assets.yaml.erb index 83d5022792..d87badf22a 100644 --- a/support/ci/assets.yaml.erb +++ b/support/ci/assets.yaml.erb @@ -7,7 +7,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> + <%= env %> strategy: fail-fast: false matrix: diff --git a/support/ci/contrib.yaml.erb b/support/ci/contrib.yaml.erb index 6cc5341c85..252e7044c0 100644 --- a/support/ci/contrib.yaml.erb +++ b/support/ci/contrib.yaml.erb @@ -19,8 +19,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + <%= env %> strategy: fail-fast: false matrix: @@ -41,8 +40,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/coverage.yaml.erb b/support/ci/coverage.yaml.erb index fa633e0d2d..1066230748 100644 --- a/support/ci/coverage.yaml.erb +++ b/support/ci/coverage.yaml.erb @@ -22,8 +22,7 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile - WORKING_DIRECTORY: <%= working_directory %> + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/db.yaml.erb b/support/ci/db.yaml.erb index 5f598951c9..5334ef0675 100644 --- a/support/ci/db.yaml.erb +++ b/support/ci/db.yaml.erb @@ -17,10 +17,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} - DATA_TYPE: ${{ matrix.data_type }} + <%= env %> services: postgres_11: image: postgres:11 @@ -74,8 +71,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/dres_client.yaml.erb b/support/ci/dres_client.yaml.erb index 096835c438..8a852b7ade 100644 --- a/support/ci/dres_client.yaml.erb +++ b/support/ci/dres_client.yaml.erb @@ -23,8 +23,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + <%= env %> strategy: fail-fast: false matrix: diff --git a/support/ci/dres_rails.yaml.erb b/support/ci/dres_rails.yaml.erb index a3da2c519c..4bccf0a918 100644 --- a/support/ci/dres_rails.yaml.erb +++ b/support/ci/dres_rails.yaml.erb @@ -23,9 +23,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} + <%= env %> services: postgres_11: image: postgres:11 diff --git a/support/ci/elm.yaml.erb b/support/ci/elm.yaml.erb index 4657accdc4..c7f808ec29 100644 --- a/support/ci/elm.yaml.erb +++ b/support/ci/elm.yaml.erb @@ -17,8 +17,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + <%= env %> strategy: fail-fast: false matrix: @@ -48,8 +47,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/generate b/support/ci/generate index f8fbb584bd..cd89313681 100755 --- a/support/ci/generate +++ b/support/ci/generate @@ -103,7 +103,10 @@ class CI name: "ruby_event_store-browser", working_directory: "ruby_event_store-browser", matrix: - generate(ruby_version(RUBY_VERSIONS), bundle_gemfile(GEMFILE, "Gemfile.rack_2_0")), + generate( + ruby_version(RUBY_VERSIONS), + bundle_gemfile(GEMFILE, "Gemfile.rack_2_0") + ), template: "elm.yaml.erb" }, { @@ -114,7 +117,11 @@ class CI { name: "rails_event_store", working_directory: "rails_event_store", - matrix: generate(ruby_version(RUBY_VERSIONS), bundle_gemfile(GEMFILE, RAILS_GEMFILES)), + matrix: + generate( + ruby_version(RUBY_VERSIONS), + bundle_gemfile(GEMFILE, RAILS_GEMFILES) + ), template: "ruby.yaml.erb" }, { @@ -130,7 +137,10 @@ class CI ruby_version(RUBY_VERSIONS), bundle_gemfile(GEMFILE), join( - generate(database_url(SQLITE3), data_type(DATA_TYPES_IN_AR.take(1))), + generate( + database_url(SQLITE3), + data_type(DATA_TYPES_IN_AR.take(1)) + ), generate(database_url(POSTGRES), data_type(DATA_TYPES_IN_AR)), generate(database_url(MYSQL), data_type(DATA_TYPES_IN_AR.take(2))) ) @@ -145,7 +155,11 @@ class CI { name: "ruby_event_store-flipper", working_directory: "contrib/ruby_event_store-flipper", - matrix: generate(ruby_version(MRI_RUBY), bundle_gemfile(GEMFILE, AS_GEMFILES)), + matrix: + generate( + ruby_version(MRI_RUBY), + bundle_gemfile(GEMFILE, AS_GEMFILES) + ), template: "contrib.yaml.erb" }, { @@ -325,13 +339,15 @@ class CI { name: "minitest-ruby_event_store", working_directory: "contrib/minitest-ruby_event_store", - matrix: generate(ruby_version(MRI_RUBY.drop(1)), bundle_gemfile(GEMFILE)), + matrix: + generate(ruby_version(MRI_RUBY.drop(1)), bundle_gemfile(GEMFILE)), template: "contrib.yaml.erb" }, { name: "minitest-ruby_event_store_coverage", working_directory: "contrib/minitest-ruby_event_store", - matrix: generate(ruby_version(MRI_RUBY.drop(1)), bundle_gemfile(GEMFILE)), + matrix: + generate(ruby_version(MRI_RUBY.drop(1)), bundle_gemfile(GEMFILE)), template: "coverage.yaml.erb" }, { @@ -342,7 +358,8 @@ class CI { name: "dres_client", working_directory: "contrib/dres_client", - matrix: generate(ruby_version(MRI_RUBY.drop(1)), bundle_gemfile(GEMFILE)), + matrix: + generate(ruby_version(MRI_RUBY.drop(1)), bundle_gemfile(GEMFILE)), template: "dres_client.yaml.erb" }, { @@ -409,6 +426,13 @@ class CI name: name, working_directory: gem.fetch(:working_directory), matrix: as_formatted_yaml(gem[:matrix], indent: 10), + env: + as_formatted_yaml( + { "WORKING_DIRECTORY" => gem.fetch(:working_directory) }.merge( + matrix_env_vars(gem[:matrix]) + ), + indent: 6 + ) ) ) @@ -416,6 +440,15 @@ class CI end end + def matrix_env_vars(matrix) + return {} unless matrix + + matrix + .first + .keys + .reduce({}) { |acc, key| acc.merge(key.upcase => "${{ matrix.#{key} }}") } + end + def as_formatted_yaml(content, indent:) Psych.dump(content).lines.drop(1).join(" " * indent).strip end diff --git a/support/ci/outbox.yaml.erb b/support/ci/outbox.yaml.erb index ff439c1e6e..83b96b283e 100644 --- a/support/ci/outbox.yaml.erb +++ b/support/ci/outbox.yaml.erb @@ -19,9 +19,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} + <%= env %> services: mysql_5: image: mysql:5 @@ -74,8 +72,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/outbox_coverage.yaml.erb b/support/ci/outbox_coverage.yaml.erb index 4617381d25..ea1108f831 100644 --- a/support/ci/outbox_coverage.yaml.erb +++ b/support/ci/outbox_coverage.yaml.erb @@ -22,8 +22,7 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile - WORKING_DIRECTORY: <%= working_directory %> + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/protobuf.yaml.erb b/support/ci/protobuf.yaml.erb index d9cd1bff2d..252e7044c0 100644 --- a/support/ci/protobuf.yaml.erb +++ b/support/ci/protobuf.yaml.erb @@ -19,9 +19,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} + <%= env %> strategy: fail-fast: false matrix: @@ -42,8 +40,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/rom.yaml.erb b/support/ci/rom.yaml.erb index 45075bf96c..3f06c3eaab 100644 --- a/support/ci/rom.yaml.erb +++ b/support/ci/rom.yaml.erb @@ -19,10 +19,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - DATABASE_URL: ${{ matrix.database_url }} - DATA_TYPE: ${{ matrix.data_type }} + <%= env %> services: postgres_11: image: postgres:11 @@ -76,8 +73,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/ruby.yaml.erb b/support/ci/ruby.yaml.erb index 75c8be5bcb..d7ec645d71 100644 --- a/support/ci/ruby.yaml.erb +++ b/support/ci/ruby.yaml.erb @@ -17,8 +17,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} + <%= env %> strategy: fail-fast: false matrix: @@ -39,8 +38,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/scheduler.yaml.erb b/support/ci/scheduler.yaml.erb index 3d7faa34b3..4f4c60ee62 100644 --- a/support/ci/scheduler.yaml.erb +++ b/support/ci/scheduler.yaml.erb @@ -19,9 +19,7 @@ jobs: test: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: ${{ matrix.bundle_gemfile }} - REDIS_URL: redis://localhost:6379/0 + <%= env %> strategy: fail-fast: false matrix: @@ -57,9 +55,7 @@ jobs: mutate: runs-on: ubuntu-20.04 env: - WORKING_DIRECTORY: <%= working_directory %> - BUNDLE_GEMFILE: Gemfile - REDIS_URL: redis://localhost:6379/0 + <%= env %> strategy: fail-fast: false steps: diff --git a/support/ci/scheduler_coverage.yaml.erb b/support/ci/scheduler_coverage.yaml.erb index a81a947bc4..b69306f9a5 100644 --- a/support/ci/scheduler_coverage.yaml.erb +++ b/support/ci/scheduler_coverage.yaml.erb @@ -22,9 +22,7 @@ jobs: runs-on: ubuntu-20.04 timeout-minutes: 120 env: - BUNDLE_GEMFILE: Gemfile - WORKING_DIRECTORY: <%= working_directory %> - REDIS_URL: redis://localhost:6379/0 + <%= env %> strategy: fail-fast: false steps: