-
-
Notifications
You must be signed in to change notification settings - Fork 122
88 lines (86 loc) · 2.53 KB
/
gemstash-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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
gemstash_tests:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3", "jruby-9.4"]
db_adapter: ["sqlite3"]
cache_type: ["memory"]
include:
- ruby: "3.3"
db_adapter: "postgres"
cache_type: "memory"
- ruby: "3.3"
db_adapter: "mysql2"
cache_type: "memory"
- ruby: "3.3"
db_adapter: "sqlite3"
cache_type: "memcached"
- ruby: "3.3"
db_adapter: "sqlite3"
cache_type: "redis"
- ruby: "jruby-9.4"
db_adapter: "postgres"
cache_type: "memory"
- ruby: "jruby-9.4"
db_adapter: "mysql2"
cache_type: "memory"
- ruby: "jruby-9.4"
db_adapter: "sqlite3"
cache_type: "memcached"
- ruby: "jruby-9.4"
db_adapter: "sqlite3"
cache_type: "redis"
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: gemstash_test
ports:
- 5432:5432
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: gemstash_test
MYSQL_USER: root
MYSQL_PASSWORD: root
ports:
- 3306:3306
memcached:
image: memcached:1.6
ports:
- 11211:11211
redis:
image: redis:7
ports:
- 6379:6379
env:
GEMSTASH_SPEC_CACHE_TYPE: ${{ matrix.cache_type }}
GEMSTASH_SPEC_DB_ADAPTER: ${{ matrix.db_adapter }}
GEMSTASH_SPEC_DB_URL: ${{ (matrix.db_adapter == 'postgres' && 'postgres://postgres:postgres@localhost/gemstash_test') || (matrix.db_adapter == 'mysql2' && 'mysql2://root:[email protected]:3306/gemstash_test') }}
GEMSTASH_SPEC_REDIS_SERVERS: redis://localhost:6379
GEMSTASH_SPEC_MEMCACHED_SERVERS: localhost:11211
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # 'bundle install' and cache
- name: increase ulimit
run: ulimit -n 8192
- name: Run Tests
run: bundle exec rspec --exclude-pattern "spec/integration_spec.rb"
- name: Run Integration Tests
run: bundle exec rspec ./spec/integration_spec.rb
timeout-minutes: 60