-
Notifications
You must be signed in to change notification settings - Fork 375
80 lines (72 loc) · 2 KB
/
Copy pathruby.yml
File metadata and controls
80 lines (72 loc) · 2 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
name: CI
on:
push:
branches: [master]
workflow_dispatch:
pull_request:
types: [
synchronize, # PR was updated
opened, # PR was open
reopened # PR was reopened
]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
ruby: [ '3.2', '3.3', '3.4', '4.0' ]
gemfile: [rails.7.2.activerecord, rails.8.0.activerecord, rails.8.1.activerecord]
name: ${{ matrix.ruby }}-${{ matrix.gemfile }}
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
services:
redis:
# Docker Hub image
image: redis
ports:
- '6379:6379'
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.19.13
ports:
- '9250:9200'
env:
discovery.type: single-node
xpack.security.enabled: 'false'
ES_JAVA_OPTS: '-Xms500m -Xmx500m'
# Set health checks to wait until Elasticsearch has started
options: >-
--health-cmd "curl -sf http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=5s"
--health-interval 10s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Tests
run: bundle exec rspec
rubocop:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
bundler-cache: true
- run: bundle exec rubocop --format github