-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.43 KB
/
Copy pathci.yml
File metadata and controls
96 lines (83 loc) · 2.43 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Rails 7.2 with Ruby 3.2+
- ruby: '3.2'
rails: '7.2'
- ruby: '3.3'
rails: '7.2'
- ruby: '3.4'
rails: '7.2'
# Rails 8.0 with Ruby 3.2+
- ruby: '3.2'
rails: '8.0'
- ruby: '3.3'
rails: '8.0'
- ruby: '3.4'
rails: '8.0'
# Rails 8.1 with Ruby 3.2+ (Rails 8.1 requires Ruby >= 3.2)
- ruby: '3.2'
rails: '8.1'
- ruby: '3.3'
rails: '8.1'
- ruby: '3.4'
rails: '8.1'
env:
RAILS_VERSION: ${{ matrix.rails }}
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: false
- name: Install dependencies
run: bundle install
- name: Start MongoDB with Replica Set
run: |
docker run -d --name mongodb -p 27017:27017 mongo:8 --replSet rs0
echo "Waiting for MongoDB to accept connections..."
for i in $(seq 1 30); do
docker exec mongodb mongosh --quiet --eval 'db.runCommand({ping:1})' >/dev/null 2>&1 && break
sleep 2
done
docker exec mongodb mongosh --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "localhost:27017"}]})'
echo "Waiting for replica set primary election..."
for i in $(seq 1 30); do
state=$(docker exec mongodb mongosh --quiet --eval 'rs.status().myState' 2>/dev/null)
[ "$state" = "1" ] && break
sleep 2
done
echo "MongoDB replica set ready (state: $state)"
- name: Run tests
run: bundle exec rspec
env:
MONGODB_HOST: localhost:27017
- name: Run RuboCop
run: bundle exec rubocop
compatibility:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
- name: Check Rails 8 compatibility
run: |
gem install bundler
bundle install
echo "Checking Rails 8 compatibility..."
bundle exec ruby -e "require 'rails'; require 'solid_queue_mongoid'; puts SolidQueue::VERSION"