-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (115 loc) · 3.06 KB
/
master.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
name: Ruby
on:
push:
branches:
- master
pull_request:
jobs:
brakeman:
runs-on: ubuntu-latest
name: run brakeman
steps:
- uses: actions/checkout@v3
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.6'
bundler-cache: true
- name: install brakeman
run: gem install brakeman
- name: run brakeman
run: brakeman --exit-on-warn
postgres:
runs-on: ubuntu-latest
name: run rspec (postgresql)
strategy:
matrix:
ruby:
- '3.3.6'
services:
postgres:
image: postgres:latest
env:
DATABASE_ADAPTER: postgresql
DATABASE_PORT: 5432
POSTGRES_USER: outboxer_developer
POSTGRES_PASSWORD: outboxer_password
POSTGRES_DB: outboxer_test
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: check postgresql
run: |
sudo apt-get -qq install -y postgresql-client
export PGPASSWORD=outboxer_password
psql -h localhost -U outboxer_developer -d outboxer_test -c 'SELECT version();'
- name: run database migrations
run: OUTBOXER_ENV=test bin/rake outboxer:db:migrate
- name: run rspec
run: OUTBOXER_ENV=test bin/rspec spec
mysql:
runs-on: ubuntu-latest
name: run rspec (mysql)
strategy:
matrix:
ruby:
- '3.3.6'
services:
mysql:
image: mysql:latest
env:
DATABASE_ADAPTER: mysql2
DATABASE_PORT: 3306
MYSQL_ROOT_PASSWORD: outboxer_password
MYSQL_DATABASE: outboxer_test
MYSQL_USER: outboxer_developer
MYSQL_PASSWORD: outboxer_password
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=5
redis:
image: redis
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: check mySQL
run: |
sudo apt-get -qq install -y mysql-client
export MYSQL_PWD=outboxer_password
mysql -h 127.0.0.1 -P 3306 -u outboxer_developer -poutboxer_password outboxer_test -e 'SELECT VERSION();'
- name: run database migrations
env:
OUTBOXER_ENV: test
DATABASE_ADAPTER: mysql2
DATABASE_HOST: 127.0.0.1
DATABASE_PORT: 3306
run: |
bin/rake outboxer:db:migrate
- name: run rspec
env:
OUTBOXER_ENV: test
DATABASE_ADAPTER: mysql2
DATABASE_PORT: 3306
DATABASE_HOST: 127.0.0.1
run: bin/rspec spec