Skip to content

Commit

Permalink
feat: add test coverage report
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Dec 25, 2023
1 parent a476dac commit 6c07266
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 42 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
on: [push, pull_request]
name: Check & fix styling

on: [push, pull_request]

jobs:
php-cs-fixer:
name: PHP-CS-Fixer
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/phpmd.yml → .github/workflows/phpmd.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
on: [push, pull_request]
name: PHPMD

on: [push, pull_request]

jobs:
phpmd:
name: PHPMD
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
push:
branches:
- master
- '*.x'
pull_request:

permissions:
contents: read

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
name: PHP ${{ matrix.php }}

container:
image: kirschbaumdevelopment/laravel-test-runner:8.1

services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: none

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

- name: Execute tests
run: vendor/bin/phpunit

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
40 changes: 0 additions & 40 deletions .github/workflows/tests.yml

This file was deleted.

0 comments on commit 6c07266

Please sign in to comment.