-
-
Notifications
You must be signed in to change notification settings - Fork 16
154 lines (138 loc) · 4.42 KB
/
split-testing.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
name: 'Tests'
on:
pull_request:
push:
branches:
- '**'
tags-ignore:
- '*.*'
jobs:
get_packages:
name: Get packages
runs-on: ubuntu-latest
steps:
- name: Set Up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
- uses: actions/checkout@v2
- name: Get Packages
id: get_json
run: echo "::set-output name=json::$(bin/get-packages)"
- name: Output Packages
run: echo "${{ steps.get_json.outputs.json }}"
outputs:
matrix: ${{ steps.get_json.outputs.json }}
split_testing:
name: Testing ${{ matrix.package.name }} separately (${{ matrix.stability }})
needs: get_packages
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.get_packages.outputs.matrix) }}
stability: [ prefer-lowest, prefer-stable ]
services:
rabbitmq:
image: rabbitmq:3.11-management-alpine
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- 5672:5672
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: "secret"
MYSQL_USER: "ecotone"
MYSQL_PASSWORD: "secret"
MYSQL_DATABASE: "ecotone"
DB_PORT: 3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=10s
--health-retries=5
ports:
- 3306:3306
postgres:
image: simplycodedsoftware/postgres:16.1
env:
POSTGRES_USER: ecotone
POSTGRES_PASSWORD: secret
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
localstack:
image: localstack/localstack:2.2.0
env:
SERVICES: 'sqs,sns'
ports:
- "4566:4566"
- "4510-4559:4510-4559"
redis:
image: redis:7-alpine
ports:
- '6379:6379'
kafka:
image: bitnami/kafka:latest
env:
KAFKA_CFG_NODE_ID: '0'
KAFKA_CFG_PROCESS_ROLES: 'controller,broker'
KAFKA_CFG_LISTENERS: 'PLAINTEXT://:9092,CONTROLLER://:9093'
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT'
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: '0@kafka:9093'
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
ports:
- 9092:9092
env:
RABBIT_HOST: amqp://127.0.0.1:5672
SQS_DSN: sqs:?key=key&secret=secret®ion=us-east-1&endpoint=http://127.0.0.1:4566&version=latest
REDIS_DSN: redis://127.0.0.1:6379
KAFKA_DSN: 127.0.0.1:9092
steps:
- uses: actions/checkout@v2
- name: Set Up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: grpc, rdkafka
coverage: pcov
- name: Enable merge-plugin
run: composer global config --no-interaction allow-plugins.wikimedia/composer-merge-plugin true && composer global require wikimedia/composer-merge-plugin
working-directory: ${{ matrix.package.directory }}
- name: Install dependencies
run: composer update --${{ matrix.stability }} --no-interaction
working-directory: ${{ matrix.package.directory }}
env:
COMPOSER_ROOT_VERSION: 'dev-main'
- name: Wait for Kafka to be ready
run: |
while ! nc -z localhost 9092; do
sleep 1
done
- name: Run tests on Postgres
run: composer tests:ci
working-directory: ${{ matrix.package.directory }}
env:
COMPOSER_ROOT_VERSION: 'dev-main'
DATABASE_DSN: pgsql://ecotone:secret@127.0.0.1:5432/ecotone
SECONDARY_DATABASE_DSN: mysql://ecotone:secret@127.0.0.1:3306/ecotone
APP_DB_HOST: 127.0.0.1
APP_DB_PORT: 5432
APP_DB_DRIVER: pdo_pgsql
- name: Run tests on Mysql
run: composer tests:ci
working-directory: ${{ matrix.package.directory }}
env:
COMPOSER_ROOT_VERSION: 'dev-main'
DATABASE_DSN: mysql://ecotone:secret@127.0.0.1:3306/ecotone
SECONDARY_DATABASE_DSN: pgsql://ecotone:secret@127.0.0.1:5432/ecotone
APP_DB_HOST: 127.0.0.1
APP_DB_PORT: 3306
APP_DB_DRIVER: pdo_mysql