-
Notifications
You must be signed in to change notification settings - Fork 174
93 lines (84 loc) · 2.31 KB
/
ci.yml
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
name: CI
on:
push: {}
pull_request:
types: [opened, synchronize]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.owner.login != 'Shopify'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
entry:
- name: 'Minimum supported'
ruby: '3.0'
gemfile: "Gemfile.min-supported"
- name: 'Latest released & run rubocop'
ruby: '3.2'
gemfile: "Gemfile.latest-release"
rubocop: true
- name: 'Rails edge'
ruby: '3.2'
gemfile: "Gemfile.rails-edge"
edge: true
name: ${{ matrix.entry.name }}
continue-on-error: ${{ matrix.entry.edge || false }}
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.entry.gemfile }}
services:
memcached:
image: memcached
ports:
- 11211:11211
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: identity_cache_test
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
ports:
- 3306:3306
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: identity_cache_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Install required packages
run: |
sudo apt-get update
sudo apt-get -y install libmemcached-dev libmysqlclient-dev libpq-dev libsasl2-dev
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.entry.ruby }}
- name: Install bundler and gems
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Test with mysql
env:
DB: mysql2
run: bundle exec rake test
- name: Test with postgres and memcached_store
env:
DB: postgresql
POSTGRES_PASSWORD: postgres
ADAPTER: memcached
run: bundle exec rake test
- name: Run rubocop
if: matrix.entry.rubocop
run: bundle exec rubocop