-
Notifications
You must be signed in to change notification settings - Fork 35
79 lines (65 loc) · 2.07 KB
/
php.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
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php:
- "7.4"
- "8.1"
services:
kafka:
image: lensesio/fast-data-dev
env:
ADV_HOST: 127.0.0.1
SAMPLEDATA: 0
RUNTESTS: 0
FORWARDLOGS: 0
ports:
- 9092:9092
- 8081:8081
- 8082:8082
- 8083:8083
- 2181:2181
steps:
- uses: actions/checkout@v2
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install rdkafka
run:
sudo add-apt-repository universe && sudo apt update && sudo apt install netcat librdkafka1 librdkafka-dev
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: xdebug
tools: pecl, phpunit
extensions: rdkafka
ini-values: post_max_size=256M, short_open_tag=On
- name: check if rdkafka is there
run: php -v && php --ri rdkafka
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer update --prefer-dist --no-progress
- name: Wait for Kafka
run: .github/workflows/wait-for-kafka.sh
- name: Unit Tests
run: ./vendor/bin/simple-phpunit --log-junit results/tests/junit.xml
#- name: try to produce
# run: echo "test" > testfile.json && kafkacat -b 0.0.0.0:9092 -t kafkacat_test -P testfile.json
# Docs: https://getcomposer.org/doc/articles/scripts.md
#- name: Run test suite
# run: phpunit --log-junit results/tests/junit.xml --coverage-html results/coverage-report --coverage-clover clover.xml