From 93c60d09a88678ed37e0d139103c056cfa87f642 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 25 Nov 2025 12:15:56 +0100 Subject: [PATCH] Omit MySQL service with if condition --- .github/workflows/ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 17c2020cb..6c26b49b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,11 +55,18 @@ jobs: strategy: matrix: - mode: [SQLite, MySQL, SaaS] + include: + - mode: SQLite + db_adapter: sqlite + - mode: MySQL + db_adapter: mysql + - mode: SaaS + db_adapter: mysql services: mysql: - image: 'mysql:8.0' + if: ${{ matrix.db_adapter == 'mysql' }} + image: mysql:8.0 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: fizzy_test @@ -73,7 +80,7 @@ jobs: env: RAILS_ENV: test - DATABASE_ADAPTER: ${{ matrix.mode == 'SQLite' && 'sqlite' || 'mysql' }} + DATABASE_ADAPTER: ${{ matrix.db_adapter }} ${{ matrix.mode == 'SaaS' && 'SAAS' || 'SAAS_DISABLED' }}: ${{ matrix.mode == 'SaaS' && '1' || '' }} BUNDLE_GEMFILE: ${{ matrix.mode == 'SaaS' && 'Gemfile.saas' || 'Gemfile' }} MYSQL_HOST: 127.0.0.1