Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Tests

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
name: PHP 8.4 Tests

steps:
- uses: actions/checkout@v4

- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: xdebug
tools: composer:v2

- name: Validate composer.json
run: composer validate --strict

- name: Cache Composer packages
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-8.4-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8.4-

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test

- name: Generate coverage report
run: ./vendor/bin/phpunit --coverage-clover coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

docker-test:
runs-on: ubuntu-latest
name: Docker Test

steps:
- uses: actions/checkout@v4

- name: Build Docker image
run: docker build -t php-result-test .

- name: Run tests in Docker
run: docker run --rm -v "$(pwd)":/app php-result-test ./vendor/bin/phpunit --testdox
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/composer.lock
/.phpstan/
/.phpunit.cache/
/.phpunit.result.cache
/coverage/
.DS_Store
/.php-cs-fixer.cache
Expand Down
Loading
Loading