|
| 1 | +name: spec |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + continue-on-error: ${{ matrix.ruby == 'head' }} |
| 9 | + env: |
| 10 | + DB: ${{ matrix.db }} |
| 11 | + BUNDLE_GEMFILE: ${{ matrix.gemfile }} |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + ruby: |
| 15 | + - 2.3 |
| 16 | + - 2.4 |
| 17 | + - 2.5 |
| 18 | + - 2.6 |
| 19 | + - 2.7 |
| 20 | + - 3.0 |
| 21 | + - head |
| 22 | + gemfile: |
| 23 | + - gemfiles/activerecord_5.0.gemfile |
| 24 | + - gemfiles/activerecord_5.2.gemfile |
| 25 | + - gemfiles/activerecord_5.1.gemfile |
| 26 | + - gemfiles/activerecord_6.0.gemfile |
| 27 | + - gemfiles/activerecord_6.1.gemfile |
| 28 | + db: |
| 29 | + - mysql |
| 30 | + - postgresql |
| 31 | + - sqlite3 |
| 32 | + exclude: |
| 33 | + # Unfortunately, the mysql2 gem encounters a segfault in the ruby 2.3 environment: |
| 34 | + - ruby: 2.3 |
| 35 | + db: mysql |
| 36 | + # Exclude ActiveRecord 6.x for Ruby < 2.5 |
| 37 | + - ruby: 2.3 |
| 38 | + gemfile: gemfiles/activerecord_6.0.gemfile |
| 39 | + - ruby: 2.3 |
| 40 | + gemfile: gemfiles/activerecord_6.1.gemfile |
| 41 | + - ruby: 2.4 |
| 42 | + gemfile: gemfiles/activerecord_6.0.gemfile |
| 43 | + - ruby: 2.4 |
| 44 | + gemfile: gemfiles/activerecord_6.1.gemfile |
| 45 | + # Exclude ActiveRecord 5.x for Ruby >= 3.0 |
| 46 | + - ruby: 3.0 |
| 47 | + gemfile: gemfiles/activerecord_5.0.gemfile |
| 48 | + - ruby: 3.0 |
| 49 | + gemfile: gemfiles/activerecord_5.1.gemfile |
| 50 | + - ruby: 3.0 |
| 51 | + gemfile: gemfiles/activerecord_5.2.gemfile |
| 52 | + - ruby: head |
| 53 | + gemfile: gemfiles/activerecord_5.0.gemfile |
| 54 | + - ruby: head |
| 55 | + gemfile: gemfiles/activerecord_5.1.gemfile |
| 56 | + - ruby: head |
| 57 | + gemfile: gemfiles/activerecord_5.2.gemfile |
| 58 | + |
| 59 | + services: |
| 60 | + postgres: |
| 61 | + image: postgres:10 |
| 62 | + env: |
| 63 | + POSTGRES_USER: postgres |
| 64 | + POSTGRES_DB: acts_as_taggable_on |
| 65 | + POSTGRES_PASSWORD: postgres |
| 66 | + ports: ['5432:5432'] |
| 67 | + options: >- |
| 68 | + --health-cmd pg_isready |
| 69 | + --health-interval 10s |
| 70 | + --health-timeout 5s |
| 71 | + --health-retries 5 |
| 72 | + mysql: |
| 73 | + image: mysql:8 |
| 74 | + env: |
| 75 | + MYSQL_ALLOW_EMPTY_PASSWORD: true |
| 76 | + ports: ['3306:3306'] |
| 77 | + options: >- |
| 78 | + --health-cmd "mysqladmin ping" |
| 79 | + --health-interval 10s |
| 80 | + --health-timeout 5s |
| 81 | + --health-retries 5 |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v2 |
| 84 | + - name: Set up Ruby |
| 85 | + uses: ruby/setup-ruby@v1 |
| 86 | + with: |
| 87 | + ruby-version: ${{ matrix.ruby }} |
| 88 | + bundler-cache: true |
| 89 | + - name: Create MySQL test database with utf8mb4 charset |
| 90 | + if: ${{ matrix.db == 'mysql' }} |
| 91 | + run: | |
| 92 | + mysql -uroot --host=127.0.0.1 -e "CREATE DATABASE acts_as_taggable_on CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci" |
| 93 | + - name: Build and test with Rake |
| 94 | + run: | |
| 95 | + bundle exec rake |
0 commit comments