-
Notifications
You must be signed in to change notification settings - Fork 1
155 lines (139 loc) · 4.55 KB
/
run_tests.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
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
# Copyright (c) 2021 SolarWinds, LLC.
# All rights reserved.
name: Run Ruby Tests on Ubuntu
on:
# push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: [3.1, 3.0, 2.7, 2.6, 2.5]
gemfile:
- libraries
- unit
- instrumentation_mocked
- instrumentation_mocked_oldgems
- frameworks
- rails70
- rails61
- rails52
- delayed_job
- redis
- noop
dbtype: [postgresql, mysql]
exclude:
- ruby: 3.1
gemfile: rails52
- ruby: 3.0
gemfile: rails52
- ruby: 2.6
gemfile: rails70
- ruby: 2.5
gemfile: rails70
- gemfile: unit
dbtype: mysql
- gemfile: noop
dbtype: mysql
- gemfile: libraries
dbtype: mysql
- gemfile: instrumentation_mocked
dbtype: mysql
- gemfile: instrumentation_mocked_oldgems
dbtype: mysql
- gemfile: frameworks
dbtype: mysql
- gemfile: delayed_job
dbtype: mysql
container:
image: ruby:${{ matrix.ruby }}
name: ${{ matrix.ruby }} - ${{ matrix.gemfile }}
env:
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
SW_APM_GEM_TEST: true
SW_APM_REPORTER: file
SW_APM_COLLECTOR: /tmp/sw_apm_traces.bson
SW_APM_REPORTER_FILE_SINGLE: false
OBOE_STAGING: true
MONGO_SERVER: "mongo"
RABBITMQ_SERVER: "rabbitmq"
MEMCACHED_SERVER: "memcached"
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_ROOT_PASSWORD: "admin"
MYSQL_HOST: "mysql"
MYSQL_DATABASE: "test_db"
POSTGRES_DB: "test_db"
DOCKER_MYSQL_PASS: "admin"
DOCKER_PSQL_PASS: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_HOST: "postgres"
REDIS_PASSWORD: "redis_pass"
services:
memcached:
image: memcached:latest
ports:
- 11211:11211
options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
mongo:
image: mongo:latest
ports:
- 27017:27017
options: --health-cmd "mongosh --quiet --eval 'quit(db.runCommand({ping:1}).ok ? 0:2)'" --health-interval 10s --health-timeout 5s --health-retries 5
postgres:
image: postgres:latest
env:
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: test_db
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
mysql:
image: mariadb:latest
env:
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: test_db
MYSQL_ROOT_PASSWORD: admin
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: apt update && apt install -y --no-install-recommends bison libcurl4-gnutls-dev libsasl2-dev postgresql-client
- name: Set database type env var
run: export DBTYPE=${{ matrix.dbtype }}
- name: Add javascript runtime
uses: actions/setup-node@v4
with:
node-version: '14'
- name: Initialize services
run: |
curl -SL http://download.redis.io/releases/redis-4.0.0.tar.gz | tar xzC /tmp && cd /tmp/redis-4.0.0/ && make && make install && cd -
redis-server --requirepass redis_pass --loglevel "warning" &
- name: Bundle
run: |
gem install bundler
export BUNDLE_GEMFILE=gemfiles/${{ matrix.gemfile }}.gemfile
bundle install --jobs 4 --retry 3
- name: Install swig 4.0.2
working-directory: .github/workflows/swig
run: |
tar -xf swig-v4.0.2.tar.gz -C /tmp
cd /tmp/swig-4.0.2
./autogen.sh && ./configure && make && make install
cd -
- name: Compile c-extension
run: |
bundle exec rake fetch compile
- name: Run tests
run: bundle exec rake test