-
Notifications
You must be signed in to change notification settings - Fork 3
128 lines (114 loc) · 3.91 KB
/
Copy pathruby.yml
File metadata and controls
128 lines (114 loc) · 3.91 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
# install dependencies and run tests
# https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
on:
push:
branches:
- main
pull_request:
jobs:
# Every supported Ruby, each with the newest ActiveRecord that Ruby can run, against SQLite (yaml and json columns).
# JRuby is not in the matrix: the test suite needs the sqlite3 gem, which is a C extension JRuby cannot load.
test_matrix:
strategy:
fail-fast: false
matrix:
os:
- ubuntu
- macos
ruby:
- 2.5
- 2.6
- 2.7
- "3.0"
- 3.1
- 3.2
- 3.3
- "3.4"
- "4.0"
- head
- truffleruby
- truffleruby-head
exclude:
- { os: macos, ruby: 2.5 } # ruby/setup-ruby has no CRuby < 2.6 build for the arm64 macos-latest runner
runs-on: ${{ matrix.os }}-latest
steps:
- name: clone ${{ github.repository }}
uses: actions/checkout@v7
- name: setup Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
# Every supported ActiveRecord version, against SQLite and MySQL (yaml and json columns) and PostgreSQL (yaml, json, jsonb and hstore columns).
# RAILS_VERSION and DB are read by the Gemfile and spec/spec_helper.rb; `include` picks a Ruby each Rails version supports.
rails_matrix:
strategy:
fail-fast: false
matrix:
rails: ["6.1", "7.0", "7.1", "7.2", "8.0", "8.1"]
db: [sqlite3, postgresql, mysql]
include:
- { rails: "6.1", ruby: "3.0" }
- { rails: "7.0", ruby: "3.2" }
- { rails: "7.1", ruby: "3.4" }
- { rails: "7.2", ruby: "3.4" }
- { rails: "8.0", ruby: "3.4" }
- { rails: "8.1", ruby: "3.4" }
runs-on: ubuntu-latest
environment: test # CODECOV_TOKEN is a secret of the GitHub environment "test"; without this line secrets.CODECOV_TOKEN is empty
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: embedded_localization_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: embedded_localization_test
ports:
- 3306:3306
options: --health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -proot" --health-interval 10s --health-timeout 5s --health-retries 10
env:
RAILS_VERSION: ${{ matrix.rails }}
DB: ${{ matrix.db }}
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
MYSQL_HOST: 127.0.0.1
MYSQL_USER: root
MYSQL_PASSWORD: root
steps:
- name: clone ${{ github.repository }}
uses: actions/checkout@v7
- name: install the MySQL client library (needed to build the mysql2 gem)
if: matrix.db == 'mysql'
run: sudo apt-get update -qq && sudo apt-get install -y -qq libmysqlclient-dev
- name: setup Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake
- name: Upload coverage to Codecov
if: matrix.db == 'postgresql' && matrix.rails == '8.1' # the PostgreSQL run covers the jsonb and hstore code paths too
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/.resultset.json
fail_ci_if_error: false
finish:
runs-on: ubuntu-latest
needs: [ test_matrix, rails_matrix ]
steps:
- name: Wait for status checks
run: echo "All Green!"