diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-11-16 09:34:24 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-11-16 09:34:24 +0000 |
commit | 9b7718af58d4271eb53614b9a7dafe8777f77673 (patch) | |
tree | 6bc6073a48bf15d83918c3d691f9ff489e7c31f9 | |
parent | 4df71054ada31b537f95bdd5cc19f1630a5297a4 (diff) | |
download | redmine-9b7718af58d4271eb53614b9a7dafe8777f77673.tar.gz redmine-9b7718af58d4271eb53614b9a7dafe8777f77673.zip |
Simplify environment setup in tests.yml (#30069).
Patch by Mizuki ISHIKAWA (user:ishikawa999).
git-svn-id: https://svn.redmine.org/redmine/trunk@23279 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | .github/workflows/tests.yml | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7017286d4..ae2eca226 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', '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: | |