-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (68 loc) · 2.21 KB
/
test-windows.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
name: Build Windows
on:
push:
pull_request:
jobs:
tests-windows:
name: Tests
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
- '8.4'
librdkafka:
- '2.6.0'
defaults:
run:
shell: bash
env:
PHP_VERSION: ${{ matrix.php }}
LIBRDKAFKA_VERSION: v${{ matrix.librdkafka }}
KAFKA_BROKERS: localhost:9092
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install librdkafka & kafka
run: |
nuget install librdkafka.redist -Version ${{ matrix.librdkafka }}
choco install --no-progress wget nssm
wget -q -O kafka_2.13-3.8.0.tgz http://ftp.fau.de/apache/kafka/3.8.0/kafka_2.13-3.8.0.tgz
tar -xzf kafka_2.13-3.8.0.tgz
cp -pr kafka_2.13-3.8.0 /c/kafka
sed -i "s|broker.id=0|broker.id=111|g" /c/kafka/config/server.properties
nssm install zookeeper /c/kafka/bin/windows/zookeeper-server-start.bat /c/kafka/config/zookeeper.properties
nssm set zookeeper AppExit Default Exit
nssm install kafka /c/kafka/bin/windows/kafka-server-start.bat /c/kafka/config/server.properties
nssm set kafka AppExit Default Exit
- name: Start Kafka
run: |
nssm start zookeeper
nssm status zookeeper
nssm start kafka
nssm status kafka
- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: ffi
- name: Install dependencies
uses: ramsey/composer-install@v2
with:
composer-options: "--prefer-dist --prefer-stable"
- name: Run tests
run: |
export PATH=$PWD/librdkafka.redist.${{ matrix.librdkafka }}/runtimes/win-x64/native:$PATH
composer test-init
vendor/bin/phpunit --debug;
- name: Stop kafka
run: |
nssm stop kafka
nssm stop zookeeper