From 59389668fbeb190494e149fbd8e22ce525244428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B0=D0=BB=D0=B8=D0=B3=D0=B6=D0=B0=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2?= Date: Fri, 7 Jul 2023 18:22:55 +0500 Subject: [PATCH] ci: PHPUnit pipeline --- .github/workflows/test/phpunit.yml | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/test/phpunit.yml diff --git a/.github/workflows/test/phpunit.yml b/.github/workflows/test/phpunit.yml new file mode 100644 index 0000000..7417a2f --- /dev/null +++ b/.github/workflows/test/phpunit.yml @@ -0,0 +1,50 @@ +name: phpunit + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + phpunit: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Setup PHP 8.2 + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + + - name: Install PHP extensions + run: sudo apt-get install -y php-phpdbg + + - name: Check phpdbg version + run: phpdbg -V + + - name: Install Composer Dependencies + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Run tests via PHPUnit + env: + XDEBUG_MODE: coverage + run: | + vendor/bin/phpunit --coverage-clover=coverage.xml + cat ./coverage.xml + + - name: Show coverage.xml + run: cat ./coverage.xml + + - name: Upload coverage.xml to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + fail_ci_if_error: true + flags: unittests + name: codecov-umbrella + verbose: true + env_vars: PHP