From 542946b855b3367f5931dd5b66e45516ed1e1556 Mon Sep 17 00:00:00 2001 From: artosepyan Date: Mon, 11 Aug 2025 16:35:22 +0300 Subject: [PATCH 1/3] fix: git hub checks --- .github/workflows/run-tests-with-coverage.yml | 52 +++++++++++++------ 1 file changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run-tests-with-coverage.yml b/.github/workflows/run-tests-with-coverage.yml index d5667ed..7e99fdd 100644 --- a/.github/workflows/run-tests-with-coverage.yml +++ b/.github/workflows/run-tests-with-coverage.yml @@ -2,9 +2,9 @@ name: Run tests with coverage on: push: - branches: ["master"] + branches: [ "master" ] pull_request: - branches: ["master"] + branches: [ "master" ] jobs: tests-with-coverage: @@ -36,25 +36,22 @@ jobs: - 5432:5432 steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up PHP - uses: shivammathur/setup-php@v2 + - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - extensions: mbstring, pdo, pdo_pgsql, gd, dom, fileinfo, pgsql - coverage: xdebug + coverage: xdebug, pcov + tools: composer:v2 env: POSTGRES_HOST: postgres POSTGRES_PORT: 5432 - + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up PostgreSQL run: | sudo apt-get update sudo apt-get install -y postgresql-client psql --version - - name: Wait for PostgreSQL run: | echo "Waiting for PostgreSQL to be ready..." @@ -68,14 +65,35 @@ jobs: done echo "PostgreSQL failed to start" exit 1 - - - name: Install Composer dependencies + - name: Install Dependencies run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: Execute unit tests via PHPUnit with coverage + run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml + - name: Export coverage report + if: ${{ matrix.php-version == '8.4' }} + uses: actions/upload-artifact@v4 + with: + name: clover.xml + path: build/logs - - name: Run PHPUnit tests with coverage - run: php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --stop-on-failure ./tests/ - + upload-to-coveralls: + needs: tests-with-coverage + runs-on: ubuntu-latest + steps: + - uses: shivammathur/setup-php@v2 + with: + php-version: "8.4" + tools: composer:v2 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v4 + with: + name: clover.xml + path: build/logs - name: Upload coverage results to Coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + run: | + composer global require php-coveralls/php-coveralls + php-coveralls --coverage_clover=build/logs/clover.xml -v --json_path=coveralls-upload.json \ No newline at end of file From 14d6784255aea25be42881dd4526000d549d396a Mon Sep 17 00:00:00 2001 From: artosepyan Date: Wed, 13 Aug 2025 11:33:01 +0300 Subject: [PATCH 2/3] fix: remarks from reviewer --- .github/workflows/run-tests-with-coverage.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run-tests-with-coverage.yml b/.github/workflows/run-tests-with-coverage.yml index 7e99fdd..6c49d47 100644 --- a/.github/workflows/run-tests-with-coverage.yml +++ b/.github/workflows/run-tests-with-coverage.yml @@ -36,15 +36,17 @@ jobs: - 5432:5432 steps: - - uses: shivammathur/setup-php@v2 + - name: Set up PHP + uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} - coverage: xdebug, pcov + coverage: xdebug tools: composer:v2 env: POSTGRES_HOST: postgres POSTGRES_PORT: 5432 - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up PostgreSQL @@ -80,14 +82,17 @@ jobs: needs: tests-with-coverage runs-on: ubuntu-latest steps: - - uses: shivammathur/setup-php@v2 + - name: Set up PHP + uses: shivammathur/setup-php@v2 with: php-version: "8.4" tools: composer:v2 - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/download-artifact@v4 + - name: Import coverage report + uses: actions/download-artifact@v4 with: name: clover.xml path: build/logs From 9dff722130b6268f6052033b97d16f6b92c6bb09 Mon Sep 17 00:00:00 2001 From: artosepyan Date: Wed, 13 Aug 2025 11:39:34 +0300 Subject: [PATCH 3/3] fix: remarks from reviewer --- .github/workflows/run-tests-with-coverage.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/run-tests-with-coverage.yml b/.github/workflows/run-tests-with-coverage.yml index 6c49d47..e251824 100644 --- a/.github/workflows/run-tests-with-coverage.yml +++ b/.github/workflows/run-tests-with-coverage.yml @@ -47,8 +47,6 @@ jobs: POSTGRES_PORT: 5432 - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Set up PostgreSQL run: | sudo apt-get update @@ -89,8 +87,6 @@ jobs: tools: composer:v2 - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Import coverage report uses: actions/download-artifact@v4 with: