|
| 1 | +name: Test MySQL |
| 2 | +on: [push, pull_request] |
| 3 | + |
| 4 | +jobs: |
| 5 | + test-latest: |
| 6 | + name: "Active Record 7.1 + Ruby 3.2" |
| 7 | + runs-on: ubuntu-latest |
| 8 | + services: |
| 9 | + mysql: |
| 10 | + image: mysql |
| 11 | + env: |
| 12 | + MYSQL_ROOT_PASSWORD: github |
| 13 | + MYSQL_USER: github |
| 14 | + MYSQL_PASSWORD: github |
| 15 | + MYSQL_DATABASE: active_record_doctor_primary |
| 16 | + options: >- |
| 17 | + --health-cmd "mysqladmin ping -h 127.0.0.1" |
| 18 | + --health-interval 10s |
| 19 | + --health-timeout 5s |
| 20 | + --health-retries 5 |
| 21 | + ports: |
| 22 | + - 3306:3306 |
| 23 | + env: |
| 24 | + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-7.1.x |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + - uses: ruby/setup-ruby@v1 |
| 28 | + with: |
| 29 | + ruby-version: "3.2" |
| 30 | + bundler-cache: true |
| 31 | + - name: Prepare the database |
| 32 | + run: | |
| 33 | + mysqladmin -h127.0.0.1 -uroot -pgithub create active_record_doctor_secondary |
| 34 | + mysql -h127.0.0.1 -uroot -pgithub -e "GRANT ALL PRIVILEGES ON active_record_doctor_secondary.* TO 'github'" |
| 35 | + - name: Run the test suite against MySQL |
| 36 | + run: bundle exec rake test:mysql2 |
| 37 | + env: |
| 38 | + # We can't use localhost because that makes the MySQL client try |
| 39 | + # connecting via a Unix socket instead of TCP. |
| 40 | + DATABASE_HOST: 127.0.0.1 |
| 41 | + DATABASE_PORT: 3306 |
| 42 | + DATABASE_USERNAME: github |
| 43 | + DATABASE_PASSWORD: github |
| 44 | + |
| 45 | + test-supported: |
| 46 | + name: "Active Record ${{ matrix.active_record }} + Ruby ${{ matrix.ruby }}" |
| 47 | + needs: [test-latest] |
| 48 | + runs-on: ubuntu-latest |
| 49 | + services: |
| 50 | + mysql: |
| 51 | + image: mysql |
| 52 | + env: |
| 53 | + MYSQL_ROOT_PASSWORD: github |
| 54 | + MYSQL_USER: github |
| 55 | + MYSQL_PASSWORD: github |
| 56 | + MYSQL_DATABASE: active_record_doctor_primary |
| 57 | + options: >- |
| 58 | + --health-cmd "mysqladmin ping -h 127.0.0.1" |
| 59 | + --health-interval 10s |
| 60 | + --health-timeout 5s |
| 61 | + --health-retries 5 |
| 62 | + ports: |
| 63 | + - 3306:3306 |
| 64 | + strategy: |
| 65 | + matrix: |
| 66 | + ruby: ["3.0", "3.1", "3.2"] |
| 67 | + active_record: ["6.1", "7.0", "7.1"] |
| 68 | + exclude: |
| 69 | + - ruby: "3.2" |
| 70 | + active_record: "7.1" |
| 71 | + env: |
| 72 | + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-${{ matrix.active_record }}.x |
| 73 | + steps: |
| 74 | + - uses: actions/checkout@v3 |
| 75 | + - uses: ruby/setup-ruby@v1 |
| 76 | + with: |
| 77 | + ruby-version: ${{ matrix.ruby }} |
| 78 | + bundler-cache: true |
| 79 | + - name: Prepare the database |
| 80 | + run: | |
| 81 | + mysqladmin -h127.0.0.1 -uroot -pgithub create active_record_doctor_secondary |
| 82 | + mysql -h127.0.0.1 -uroot -pgithub -e "GRANT ALL PRIVILEGES ON active_record_doctor_secondary.* TO 'github'" |
| 83 | + - name: Run the test suite against MySQL |
| 84 | + run: bundle exec rake test:mysql2 |
| 85 | + env: |
| 86 | + # We can't use localhost because that makes the MySQL client try |
| 87 | + # connecting via a Unix socket instead of TCP. |
| 88 | + DATABASE_HOST: 127.0.0.1 |
| 89 | + DATABASE_PORT: 3306 |
| 90 | + DATABASE_USERNAME: github |
| 91 | + DATABASE_PASSWORD: github |
| 92 | + |
| 93 | + test-unsupported: |
| 94 | + name: "Active Record ${{ matrix.active_record }} + Ruby ${{ matrix.ruby }}" |
| 95 | + needs: [test-supported] |
| 96 | + runs-on: ubuntu-latest |
| 97 | + services: |
| 98 | + mysql: |
| 99 | + image: mysql |
| 100 | + env: |
| 101 | + MYSQL_ROOT_PASSWORD: github |
| 102 | + MYSQL_USER: github |
| 103 | + MYSQL_PASSWORD: github |
| 104 | + MYSQL_DATABASE: active_record_doctor_primary |
| 105 | + options: >- |
| 106 | + --health-cmd "mysqladmin ping -h 127.0.0.1" |
| 107 | + --health-interval 10s |
| 108 | + --health-timeout 5s |
| 109 | + --health-retries 5 |
| 110 | + ports: |
| 111 | + - 3306:3306 |
| 112 | + strategy: |
| 113 | + matrix: |
| 114 | + ruby: ["2.4", "2.5", "2.6", "2.7"] |
| 115 | + active_record: ["4.2", "5.0", "5.1", "5.2", "6.0"] |
| 116 | + exclude: |
| 117 | + - ruby: "2.7" |
| 118 | + active_record: "4.2" |
| 119 | + - ruby: "2.4" |
| 120 | + active_record: "6.0" |
| 121 | + include: |
| 122 | + - ruby: "3.0" |
| 123 | + active_record: "6.0" |
| 124 | + - ruby: "3.1" |
| 125 | + active_record: "6.0" |
| 126 | + - ruby: "3.2" |
| 127 | + active_record: "6.0" |
| 128 | + env: |
| 129 | + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/Gemfile.activerecord-${{ matrix.active_record }}.x |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v3 |
| 132 | + - uses: ruby/setup-ruby@v1 |
| 133 | + with: |
| 134 | + ruby-version: ${{ matrix.ruby }} |
| 135 | + rubygems: ${{ (matrix.ruby == '2.4' || matrix.ruby == '2.5' || matrix.ruby == '2.6') && '3.2.3' || '' }} |
| 136 | + bundler-cache: true |
| 137 | + - name: Prepare the database |
| 138 | + run: | |
| 139 | + mysqladmin -h127.0.0.1 -uroot -pgithub create active_record_doctor_secondary |
| 140 | + mysql -h127.0.0.1 -uroot -pgithub -e "GRANT ALL PRIVILEGES ON active_record_doctor_secondary.* TO 'github'" |
| 141 | + - name: Run the test suite against MySQL |
| 142 | + run: bundle exec rake test:mysql2 |
| 143 | + env: |
| 144 | + # We can't use localhost because that makes the MySQL client try |
| 145 | + # connecting via a Unix socket instead of TCP. |
| 146 | + DATABASE_HOST: 127.0.0.1 |
| 147 | + DATABASE_PORT: 3306 |
| 148 | + DATABASE_USERNAME: github |
| 149 | + DATABASE_PASSWORD: github |
0 commit comments