File: ci.yml

package info (click to toggle)
ruby-jsonb-accessor 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 316 kB
  • sloc: ruby: 1,819; makefile: 10; sh: 5
file content (70 lines) | stat: -rw-r--r-- 2,847 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: CI

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  lint:
    runs-on: ubuntu-24.04
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

    - uses: ruby/setup-ruby@80740b3b13bf9857e28854481ca95a84e78a2bdf # v1.284.0
      with:
        ruby-version: "3.4"
        bundler-cache: true

    - run: bundle exec rubocop

  tests:
    needs: lint
    runs-on: ubuntu-24.04
    strategy:
      fail-fast: false
      matrix:
        ruby:         ["ruby-3.2", "ruby-3.3", "ruby-3.4", "ruby-4.0", "jruby-9.4", "jruby-10.0"]
        activerecord: ["6.1", "7.0", "7.1", "7.2", "8.0", "8.1"]
        postgresql:   ["13", "14", "15", "16", "17", "18"]
        exclude:
          # fails due to "ArgumentError: when initializing an Active Record adapter with a config hash, that should be the only argument" in db:schema:load
          - ruby: "jruby-9.4"
            activerecord: "7.2"
          - ruby: "jruby-9.4"
            activerecord: "8.0"
          # fails due to "Because activerecord >= 8.0.0.beta1 depends on Ruby >= 3.2.0 and Gemfile depends on activerecord ~> 8.1, Ruby >= 3.2.0 is required. So, because current Ruby version is = 3.1.7, version solving has failed."
          - ruby: "jruby-9.4"
            activerecord: "8.1"
          # https://github.com/jruby/activerecord-jdbc-adapter/issues/1173
          - ruby: "jruby-10.0"
            activerecord: "8.0"
          # https://github.com/jruby/activerecord-jdbc-adapter/issues/1184
          - ruby: "jruby-10.0"
            activerecord: "8.1"
    name: "Active Record ${{ matrix.activerecord }} with PostgreSQL ${{ matrix.postgresql }} on ${{ matrix.ruby }}"
    services:
      db:
        image: postgres:${{ matrix.postgresql }}
        env:
          POSTGRES_HOST_AUTH_METHOD: trust
          POSTGRES_DB: jsonb_accessor
        ports: ['5432:5432']
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
    steps:
    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

    - run: echo "gem 'activerecord', '~> ${{ matrix.activerecord }}.0'" > Gemfile.local

    - if:  matrix.activerecord == '6.1' # see https://github.com/rails/rails/pull/54264#issuecomment-2596149819 and https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/#standard-library-updates and https://www.ruby-lang.org/en/news/2025/12/25/ruby-4-0-0-released/#stdlib-updates
      run: printf "gem 'concurrent-ruby', '< 1.3.5'\ngem 'mutex_m'\ngem 'base64'\ngem 'bigdecimal'\ngem 'logger'\n" >> Gemfile.local

    - uses: ruby/setup-ruby@80740b3b13bf9857e28854481ca95a84e78a2bdf # v1.284.0
      with:
        ruby-version: ${{ matrix.ruby }}
        bundler-cache: true

    - run: bundle exec rake db:schema:load

    - run: bundle exec rake spec