-
Notifications
You must be signed in to change notification settings - Fork 5
148 lines (138 loc) · 4.47 KB
/
test.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
name: Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php: '8.1'
librdkafka: 'v2.6.1'
publish: true
exclude:
- php: '8.1'
librdkafka: 'v2.6.1'
publish: false
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
- '8.3'
- '8.4'
librdkafka:
- 'v2.8.0'
- 'v2.6.1'
- 'v2.5.3'
- 'v2.4.0'
- 'v2.3.0'
- 'v2.2.1'
- 'v2.1.1'
- 'v2.0.2'
- 'v1.9.2'
- 'v1.8.2'
- 'v1.7.0'
- 'v1.6.2'
- 'v1.5.3'
- 'v1.4.4'
- 'v1.3.0'
- 'v1.2.2'
- 'v1.1.0'
- 'v1.0.1'
- 'master'
publish:
- false
continue-on-error: ${{ matrix.librdkafka == 'master' }}
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.8.0
ports:
- 2181:2181
env:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:7.8.0
ports:
- 9092:9092
env:
KAFKA_BROKER_ID: 111
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
env:
PHP_VERSION: ${{ matrix.php }}
LIBRDKAFKA_VERSION: ${{ matrix.librdkafka }}
KAFKA_BROKERS: localhost:9092
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache librdkafka ${{ matrix.librdkafka }} build
id: librdkafka-build-cache
uses: actions/cache@v4
with:
path: ~/build-cache/librdkafka
key: ${{ runner.os }}-librdkafka-${{ matrix.librdkafka }}
- name: Build librdkafka ${{ matrix.librdkafka }}
if: ${{ steps.librdkafka-build-cache.outputs.cache-hit != 'true' }}
run: |
git clone --branch "${{ matrix.librdkafka }}" -c advice.detachedHead=false --depth 1 https://github.com/confluentinc/librdkafka.git /tmp/librdkafka; \
cd /tmp/librdkafka
./configure --install-deps
make
mkdir -p ~/build-cache/librdkafka
sudo make install DESTDIR=~/build-cache/librdkafka
- name: Install librdkafka ${{ matrix.librdkafka }}
run: |
sudo rsync -av ~/build-cache/librdkafka/ /
sudo ldconfig
- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
extensions: ffi, pcntl, xdebug
ini-values: "${{ (matrix.php == '8.3' || matrix.php == '8.4') && 'zend.max_allowed_stack_size=-1' || '' }}"
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--prefer-dist --prefer-stable"
- name: Run tests
run: |
composer test-init
composer test-coverage
- name: Publish code coverage to codeclimate
if: matrix.publish == true && github.event_name == 'push'
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Prepare docs
if: matrix.publish == true && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
composer prepare-docs
- name: Setup Python
if: matrix.publish == true && github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Setup mkdocs-material
if: matrix.publish == true && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
pip install mkdocs-material mkdocs-awesome-pages-plugin
- name: Generate & publish docs
if: matrix.publish == true && github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
mkdocs gh-deploy --force