]> source.dussan.org Git - redmine.git/commitdiff
Simplify environment setup in tests.yml (#30069).
authorMarius Balteanu <marius.balteanu@zitec.com>
Sat, 16 Nov 2024 09:34:24 +0000 (09:34 +0000)
committerMarius Balteanu <marius.balteanu@zitec.com>
Sat, 16 Nov 2024 09:34:24 +0000 (09:34 +0000)
 Patch by Mizuki ISHIKAWA (user:ishikawa999).

git-svn-id: https://svn.redmine.org/redmine/trunk@23279 e93f8b46-1217-0410-a6f0-8f06a7374b81

.github/workflows/tests.yml

index 7017286d4cb8b6dd355882f3ce18f37213166585..ae2eca226f342508db97133ac7a65844335fc95f 100644 (file)
@@ -11,7 +11,7 @@ jobs:
     strategy:
       matrix:
         ruby: ['3.1', '3.2', '3.3']
-        db: ['postgresql', 'mysql']
+        db: ['postgresql', 'mysql2']
       fail-fast: false
 
     services:
@@ -59,46 +59,31 @@ jobs:
           sudo rm /etc/ImageMagick-6/policy.xml
           sudo mv policy.xml /etc/ImageMagick-6/policy.xml
 
+      - name: Prepare Redmine database configuration
+        run: |
+          cat > config/database.yml <<EOF
+          test:
+            adapter: ${{ matrix.db }}
+            database: redmine_test
+            username: root
+            password: root
+            host: 127.0.0.1
+          EOF
+
       - name: Install Ruby and gems
         uses: ruby/setup-ruby@v1.176.0
         with:
           ruby-version: ${{ matrix.ruby }}
           bundler-cache: true
 
-      - name: Prepare Redmine configuration for PostgreSQL
-        run: |
-          cp config/database.yml.example config/database.yml
-          sed -i -e "s/mysql2$/postgresql/g" config/database.yml
-          sed -i -e "s/host:.*$/host: localhost/g" config/database.yml
-          sed -i -e "s/password:.*$/password: root/g" config/database.yml
-          sed -i -e "41,43d" config/database.yml
-        if: matrix.db == 'postgresql'
-
-      - name: Prepare Redmine configuration for MySQL
-        run: |
-          cp config/database.yml.example config/database.yml
-          sed -i -e "s/host:.*$/host: 127.0.0.1/g" config/database.yml
-          sed -i -e "s/password:.*$/password: root/g" config/database.yml
-        if: matrix.db == 'mysql'
-
-      - name: Install dependencies
-        env:
-          RAILS_ENV: test
-        run: bundle install --jobs=4 --retry=3
-
-      - name: Run DB migration
-        env:
-          RAILS_ENV: test
-        run: bundle exec rake db:migrate
-
-      - name: Run SCM setup for Git, Git UTF8, Subversion and Filesystem
+      - name: Run prepare test environment
         env:
           RAILS_ENV: test
+          SCMS: subversion,git,git_utf8,filesystem
         run: |
-          bundle exec rake test:scm:setup:git
-          bundle exec rake test:scm:setup:git_utf8
-          bundle exec rake test:scm:setup:subversion
-          bundle exec rake test:scm:setup:filesystem
+          bundle exec rake ci:about
+          bundle exec rake ci:setup
+          bundle exec rake db:environment:set
 
       - name: Run tests
         run: |