Use committed database.yml instead of generating it in CI

The repo's config/database.yml already handles both SQLite (default) and
MySQL (DB_ADAPTER=mysql) via ERB. Remove the redundant steps that overwrote
it with a hardcoded version, and pass DB_ADAPTER=mysql for the MySQL job.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 04:30:11 +00:00
parent 754cfdba11
commit 8a1b8d33d6

View File

@@ -20,15 +20,6 @@ jobs:
env: env:
BUNDLE_WITH: "sqlite:development:test" BUNDLE_WITH: "sqlite:development:test"
- name: Generate database.yml
run: |
cat > config/database.yml <<'EOF'
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
EOF
- name: Set up test database - name: Set up test database
run: bin/rails db:create db:schema:load run: bin/rails db:create db:schema:load
env: env:
@@ -69,27 +60,15 @@ jobs:
env: env:
BUNDLE_WITH: "mysql:development:test" BUNDLE_WITH: "mysql:development:test"
- name: Generate database.yml
run: |
cat > config/database.yml <<'EOF'
test:
adapter: mysql2
encoding: utf8mb4
collation: utf8mb4_0900_as_ci
database: fixin_test
host: 127.0.0.1
username: root
password: ""
pool: 5
EOF
- name: Set up test database - name: Set up test database
run: bin/rails db:schema:load run: bin/rails db:schema:load
env: env:
RAILS_ENV: test RAILS_ENV: test
DB_ADAPTER: mysql
- name: Run tests - name: Run tests
run: bin/rails test run: bin/rails test
env: env:
RAILS_ENV: test RAILS_ENV: test
CI: "true" CI: "true"
DB_ADAPTER: mysql