forked from vernemq/vernemq
-
Notifications
You must be signed in to change notification settings - Fork 3
152 lines (146 loc) · 3.77 KB
/
pr.yml
File metadata and controls
152 lines (146 loc) · 3.77 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: checks format & runs tests
on:
push:
branches:
- 'main'
pull_request:
release:
types:
- published
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
# Default OTP version used for current releases
DEFAULT_RELEASE_OTP: 27
jobs:
code_checks:
name: Check code style and quality
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.DEFAULT_RELEASE_OTP }}
version-type: strict
- run: sudo apt-get -y install libsnappy-dev
- name: Check code formatting (erlfmt)
run: ./rebar3 fmt -c
- name: Run dialyzer type checker
run: ./rebar3 dialyzer
continue-on-error: true
coverage:
runs-on: ubuntu-22.04
timeout-minutes: 90
needs: code_checks
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: vmq_test_user
POSTGRES_PASSWORD: vmq_test_password
POSTGRES_DB: vmq_test_database
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached
ports:
- 11211:11211
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redissentinel:
image: bitnami/redis-sentinel
ports:
- 26379:26379
options: >-
--health-cmd "redis-cli -p 26379 ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: 27.0
version-type: strict
- run: sudo apt-get -y install libsnappy-dev
- run: sudo apt-get -y install pcregrep
- run: make rel
# - run: make db-setup
- run: pwd
- run: sh ./run-tests-with-retry.sh .
tests:
name: Test on ${{ matrix.os }} with OTP ${{ matrix.otp }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
otp:
- "27.0"
- "26.0"
- "25.0"
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: vmq_test_user
POSTGRES_PASSWORD: vmq_test_password
POSTGRES_DB: vmq_test_database
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached
ports:
- 11211:11211
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redissentinel:
image: bitnami/redis-sentinel
ports:
- 26379:26379
options: >-
--health-cmd "redis-cli -p 26379 ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- run: sudo apt-get -y install libsnappy-dev
- run: sudo apt-get -y install pcregrep
- run: make rel
# - run: make db-setup
- run: pwd
- run: sh ./run-tests-with-retry.sh .