-
Notifications
You must be signed in to change notification settings - Fork 0
175 lines (166 loc) · 5.43 KB
/
Copy pathci.yml
File metadata and controls
175 lines (166 loc) · 5.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: CI
on:
push:
pull_request:
workflow_dispatch:
jobs:
sqlite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake
javascript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
- run: npm ci
- run: npm test
- run: npx playwright install --with-deps chromium
- run: npm run test:browser
compatibility:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: [ "3.3", "3.4", "4.0" ]
rails-version: [ "7.1", "7.2", "8.0", "8.1" ]
env:
RAILS_VERSION: ${{ matrix.rails-version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: false
- run: bundle lock --update && bundle install --jobs 4
- run: bundle exec rake test
redis:
runs-on: ubuntu-latest
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake test TEST=test/integration/redis_wake_up_test.rb
postgresql:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:18
env:
POSTGRES_USER: solid_objects
POSTGRES_PASSWORD: solid_objects
POSTGRES_DB: solid_objects_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U solid_objects"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
SOLID_OBJECTS_DATABASE_URL: postgresql://solid_objects:solid_objects@127.0.0.1:5432/solid_objects_test
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake test
mysql:
runs-on: ubuntu-latest
# Both clients speak MySQL but report different adapter names, negotiate
# different connection collations, and name the same error code
# differently, so passing on one proves nothing about the other.
strategy:
fail-fast: false
matrix:
client: [ mysql2, trilogy ]
services:
mysql:
image: mysql:8.4
env:
MYSQL_USER: solid_objects
MYSQL_PASSWORD: solid_objects
MYSQL_DATABASE: solid_objects_test
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -proot"
--health-interval 5s
--health-timeout 5s
--health-retries 20
env:
SOLID_OBJECTS_DATABASE_URL: ${{ matrix.client }}://solid_objects:solid_objects@127.0.0.1:3306/solid_objects_test
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake test
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake standard rubocop rbs steep security
release:
if: startsWith(github.ref, 'refs/tags/v')
needs:
- sqlite
- postgresql
- mysql
- static
- javascript
- compatibility
- redis
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Verify release tag
run: |
version=$(ruby -Ilib -e 'require "solid_objects/version"; print SolidObjects::VERSION')
test "$GITHUB_REF_NAME" = "v$version"
- name: Build gem
run: gem build solid_objects.gemspec
- name: Configure RubyGems credentials
uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a
- name: Push to RubyGems
run: gem push solid_objects-*.gem
- name: Create GitHub release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
with:
files: solid_objects-*.gem
generate_release_notes: true