Skip to content

TestCase

TestCase #24

Workflow file for this run

name: "tests"
on: [ push, pull_request ]
jobs:
test:
timeout-minutes: 3
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
php-version: [ "8.2"]
laravel: [11]
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
- name: Start Centrifugo
run: docker run -d -p 8000:8000 -e CENTRIFUGO_TOKEN_HMAC_SECRET_KEY="secret" -e CENTRIFUGO_YOUR-API-KEY-HERE="api-key" -e CENTRIFUGO_PRESENCE=1 -e CENTRIFUGO_JOIN_LEAVE=true -e CENTRIFUGO_FORCE_PUSH_JOIN_LEAVE=true -e CENTRIFUGO_HISTORY_TTL=300s -e CENTRIFUGO_HISTORY_SIZE=100 -e CENTRIFUGO_FORCE_RECOVERY=true -e CENTRIFUGO_USER_SUBSCRIBE_TO_PERSONAL=true -e CENTRIFUGO_ALLOW_PUBLISH_FOR_SUBSCRIBER=true -e CENTRIFUGO_ALLOW_PRESENCE_FOR_SUBSCRIBER=true -e CENTRIFUGO_ALLOW_HISTORY_FOR_SUBSCRIBER=true centrifugo/centrifugo:v5 centrifugo
- 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: Install dependencies
run: |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: PHPUnit Tests
run: vendor/bin/phpunit