Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 0 additions & 73 deletions .github/workflows/mercure.yml

This file was deleted.

161 changes: 156 additions & 5 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4', '8.5']
include:
- php-version: '8.2'
coverage: none
command: composer test
- php-version: '8.3'
coverage: xdebug
command: vendor/bin/phpunit --coverage-text
- php-version: '8.4'
coverage: none
command: composer test
- php-version: '8.5'
coverage: none
command: composer test

steps:
- name: Checkout
Expand All @@ -41,7 +53,7 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: composer
extensions: json, mbstring, xml
coverage: xdebug
coverage: ${{ matrix.coverage }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -64,15 +76,154 @@ jobs:
fi

- name: Test with PHPUnit
run: vendor/bin/phpunit --coverage-text
run: ${{ matrix.command }}
env:
TERM: xterm-256color

- if: matrix.php-version == '8.3'
name: Run Coveralls
name: Upload unit coverage
uses: coverallsapp/github-action@v2.3.8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: build/phpunit/clover.xml
format: clover
flag-name: PHP ${{ matrix.php-version }}
flag-name: unit
parallel: true

redis:
name: Redis Integration Coverage
runs-on: ubuntu-latest
if: (! contains(github.event.head_commit.message, '[ci skip]'))
services:
redis:
image: redis:7.4-alpine
ports:
- 16379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 1s
--health-timeout 1s
--health-retries 10

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer
extensions: json, mbstring, pcntl, xml
coverage: xdebug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> "$GITHUB_ENV"

- name: Cache composer dependencies
uses: actions/cache@v6
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi

- name: Test Redis integration with coverage
run: SSE_REDIS_INTEGRATION=1 vendor/bin/phpunit --coverage-text --group integration
env:
TERM: xterm-256color

- name: Upload Redis integration coverage
uses: coverallsapp/github-action@v2.3.8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: build/phpunit/clover.xml
format: clover
flag-name: redis
parallel: true

mercure:
name: Mercure Integration Coverage
runs-on: ubuntu-latest
if: (! contains(github.event.head_commit.message, '[ci skip]'))
services:
mercure:
image: dunglas/mercure:v0.24.2
env:
SERVER_NAME: ':80'
MERCURE_PUBLISHER_JWT_KEY: development-publisher-key-change-before-production
MERCURE_SUBSCRIBER_JWT_KEY: development-subscriber-key-change-before-production
MERCURE_EXTRA_DIRECTIVES: heartbeat 1s
ports:
- 3000:80

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer
extensions: curl, json, mbstring, xml
coverage: xdebug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get composer cache directory
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> "$GITHUB_ENV"

- name: Cache composer dependencies
uses: actions/cache@v6
with:
path: ${{ env.COMPOSER_CACHE_FILES_DIR }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: |
if [ -f composer.lock ]; then
composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
else
composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
fi

- name: Test Mercure integration with coverage
run: SSE_MERCURE_INTEGRATION=1 vendor/bin/phpunit --coverage-text --group integration
env:
TERM: xterm-256color

- name: Upload Mercure integration coverage
uses: coverallsapp/github-action@v2.3.8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: build/phpunit/clover.xml
format: clover
flag-name: mercure
parallel: true

coveralls:
needs:
- main
- redis
- mercure
name: Coveralls Finished
runs-on: ubuntu-latest
if: ${{ always() && ! contains(github.event.head_commit.message, '[ci skip]') }}

steps:
- name: Finish parallel Coveralls build
uses: coverallsapp/github-action@v2.3.8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
73 changes: 0 additions & 73 deletions .github/workflows/redis.yml

This file was deleted.