From 1626027df253fcb3f81ffc678a29dc4b4f6c967c Mon Sep 17 00:00:00 2001
From: Katsuya Hidaka <hidakatsuya@gmail.com>
Date: Tue, 10 Dec 2024 00:40:18 +0900
Subject: Add tests with SQLite3 to CI

---
 .github/workflows/tests.yml | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index d7c6ca8e3..6d902490d 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -11,7 +11,7 @@ jobs:
     strategy:
       matrix:
         ruby: ['3.1', '3.2', '3.3']
-        db: ['postgresql', 'mysql2']
+        db: ['postgresql', 'mysql2', 'sqlite3']
       fail-fast: false
 
     services:
@@ -60,7 +60,17 @@ jobs:
           sudo rm /etc/ImageMagick-6/policy.xml
           sudo mv policy.xml /etc/ImageMagick-6/policy.xml
 
-      - name: Prepare Redmine database configuration
+      - if: ${{ matrix.db == 'sqlite3' }}
+        name: Prepare test database for sqlite3
+        run: |
+          cat > config/database.yml <<EOF
+          test:
+            adapter: sqlite3
+            database: db/test.sqlite3
+          EOF
+
+      - if: ${{ matrix.db == 'mysql2' || matrix.db == 'postgresql' }}
+        name: Prepare test database for mysql2 and postgresql
         run: |
           cat > config/database.yml <<EOF
           test:
-- 
2.45.2

