-
-
Notifications
You must be signed in to change notification settings - Fork 41
40 lines (31 loc) · 1.02 KB
/
ci.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
name: "test"
on: [push, pull_request]
jobs:
test:
name: Test with PHP ${{ matrix.php-version }}
runs-on: ubuntu-latest
# Prevent duplicate builds on internal PRs.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
php-version: ["7.4", "8.0"]
steps:
- uses: "actions/checkout@v2"
- uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
- name: Composer install
uses: "ramsey/composer-install@v1"
- name: Start Centrifugo
run: docker run -d -p 8000:8000 centrifugo/centrifugo:latest centrifugo --api_insecure
- name: Check container status
run: docker ps
- name: Wait for server to be ready
run: |
while ! curl -s http://localhost:8000 > /dev/null; do
echo "Waiting for server..."
sleep 1
done
shell: bash
- name: Run tests
run: vendor/bin/phpunit