|
1 | 1 | --- |
2 | | -name: test |
| 2 | +name: PostgreSQL |
3 | 3 | on: [push, pull_request] |
| 4 | +permissions: |
| 5 | + contents: read |
| 6 | +concurrency: |
| 7 | + group: postgresql-${{ github.ref }} |
| 8 | + cancel-in-progress: true |
4 | 9 | jobs: |
5 | 10 | test: |
6 | | - runs-on: ubuntu-latest |
| 11 | + runs-on: ubuntu-24.04 |
| 12 | + timeout-minutes: 20 |
| 13 | + env: |
| 14 | + DATABASE_ADAPTER: activerecord |
| 15 | + ACTIVERECORD_VERSION: ${{ matrix.entry.active_record }} |
| 16 | + GRAPE_VERSION: ${{ matrix.entry.grape || '>= 0' }} |
| 17 | + JSON_VERSION: ${{ matrix.entry.json }} |
| 18 | + DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_test |
7 | 19 | strategy: |
| 20 | + fail-fast: false |
8 | 21 | matrix: |
9 | 22 | entry: |
10 | | - - { ruby: 3.2, postgresql: 11, active_record: '~> 6.0.0' } |
11 | | - - { ruby: 3.2, postgresql: 11, active_record: '~> 6.1.0' } |
12 | | - - { ruby: 3.2, postgresql: 14, active_record: '~> 7.0.0' } |
13 | | - - { ruby: 3.3, postgresql: 14, active_record: '~> 7.2.0' } |
14 | | - - { ruby: 3.4, postgresql: 14, active_record: '~> 7.2.0' } |
15 | | - - { ruby: 3.4, postgresql: 15, active_record: '~> 8.0.2' } |
16 | | - - { ruby: 3.4, postgresql: 16, active_record: '~> 8.0.2' } |
17 | | - - { ruby: 3.4, postgresql: 17, active_record: '~> 8.0.2' } |
18 | | - name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }}, active_record=${{ matrix.entry.active_record }}) |
| 23 | + # Active Support 6.x, 7.0, and 8.0 pass quirks_mode, removed in JSON 3. |
| 24 | + - { ruby: '3.2', postgresql: '11', active_record: '~> 6.0.0', json: '~> 2.0' } |
| 25 | + - { ruby: '3.2', postgresql: '11', active_record: '~> 6.1.0', json: '~> 2.0' } |
| 26 | + - { ruby: '3.2', postgresql: '14', active_record: '~> 7.0.0', json: '~> 2.0' } |
| 27 | + - { ruby: '3.3', postgresql: '14', active_record: '~> 7.2.0', json: '~> 3.0' } |
| 28 | + - { ruby: '3.4', postgresql: '14', active_record: '~> 7.2.0', json: '~> 3.0' } |
| 29 | + - { ruby: '3.4', postgresql: '15', active_record: '~> 8.0.2', json: '~> 2.0' } |
| 30 | + - { ruby: '3.4', postgresql: '16', active_record: '~> 8.0.2', json: '~> 2.0' } |
| 31 | + - { ruby: '3.4', postgresql: '17', active_record: '~> 8.0.2', json: '~> 2.0' } |
| 32 | + - { ruby: '3.3', postgresql: '18', active_record: '~> 8.1', grape: '~> 3.2', json: '~> 3.0' } |
| 33 | + - { ruby: '3.4', postgresql: '18', active_record: '~> 8.1', grape: '~> 4.0', json: '~> 3.0' } |
| 34 | + - { ruby: '4.0', postgresql: '18', active_record: '~> 8.1', grape: '~> 4.0', json: '~> 3.0' } |
| 35 | + name: test (ruby=${{ matrix.entry.ruby }}, postgresql=${{ matrix.entry.postgresql }}, active_record=${{ matrix.entry.active_record }}, grape=${{ matrix.entry.grape || 'auto' }}, json=${{ matrix.entry.json }}) |
| 36 | + services: |
| 37 | + postgresql: |
| 38 | + image: postgres:${{ matrix.entry.postgresql }} |
| 39 | + env: |
| 40 | + POSTGRES_DB: slack_ruby_bot_server_test |
| 41 | + POSTGRES_USER: test |
| 42 | + POSTGRES_PASSWORD: password |
| 43 | + ports: |
| 44 | + - 5432:5432 |
| 45 | + options: >- |
| 46 | + --health-cmd "pg_isready -U test -d slack_ruby_bot_server_test" |
| 47 | + --health-interval 10s |
| 48 | + --health-timeout 5s |
| 49 | + --health-retries 10 |
19 | 50 | steps: |
20 | | - - uses: actions/checkout@v2 |
| 51 | + - uses: actions/checkout@v7 |
21 | 52 | - uses: ruby/setup-ruby@v1 |
22 | 53 | with: |
23 | 54 | ruby-version: ${{ matrix.entry.ruby }} |
24 | | - - uses: browser-actions/setup-geckodriver@latest |
25 | | - with: |
26 | | - token: ${{ secrets.GITHUB_TOKEN }} |
27 | | - - run: geckodriver --version |
28 | | - - uses: harmon758/postgresql-action@v1 |
| 55 | + bundler-cache: true |
| 56 | + cache-version: activerecord-${{ matrix.entry.active_record }}-grape-${{ matrix.entry.grape || 'auto' }}-json-${{ matrix.entry.json }} |
| 57 | + - uses: browser-actions/setup-firefox@v1.7.2 |
29 | 58 | with: |
30 | | - postgresql version: ${{ matrix.entry.postgresql }} |
31 | | - postgresql db: slack_ruby_bot_server_test |
32 | | - postgresql user: test |
33 | | - postgresql password: password |
| 59 | + firefox-version: latest |
34 | 60 | - name: Test |
35 | | - uses: GabrielBB/xvfb-action@v1 |
36 | | - env: |
37 | | - DATABASE_ADAPTER: activerecord |
38 | | - ACTIVERECORD_VERSION: ${{ matrix.entry.active_record }} |
39 | | - DATABASE_URL: postgres://test:password@localhost/slack_ruby_bot_server_test |
40 | | - with: |
41 | | - run: | |
42 | | - bundle install |
43 | | - bundle exec rake spec |
| 61 | + run: xvfb-run --auto-servernum bundle exec rake spec |
0 commit comments