From fa35e1ed0acf2f0a08904e02b6d00844a7a2fe75 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 7 Jul 2025 10:00:00 +0200 Subject: [PATCH 1/4] Refactor test pipeline on GitHub Actions --- .github/workflows/tests.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 956e0ec61..2fd58f183 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,36 +23,38 @@ jobs: fail-fast: true matrix: os: - - "ubuntu-22.04" + - "ubuntu-24.04" php-version: - "8.1" - "8.2" - "8.3" - "8.4" mongodb-version: - - "6.0" + - "8.0" topology: - - "server" + - "replica_set" include: + # Test additional topologies for MongoDB 8.0 + - os: "ubuntu-24.04" + php-version: "8.4" + mongodb-version: "8.0" + topology: "server" + - os: "ubuntu-24.04" + php-version: "8.4" + mongodb-version: "8.0" + topology: "sharded_cluster" + # Test lowest server/php versions - os: "ubuntu-22.04" php-version: "8.1" mongodb-version: "6.0" - topology: "replica_set" + topology: "server" - os: "ubuntu-22.04" php-version: "8.1" mongodb-version: "6.0" - topology: "sharded_cluster" - - os: "ubuntu-24.04" - php-version: "8.1" - mongodb-version: "8.0" - topology: "server" - - os: "ubuntu-24.04" - php-version: "8.1" - mongodb-version: "8.0" topology: "replica_set" - - os: "ubuntu-24.04" + - os: "ubuntu-22.04" php-version: "8.1" - mongodb-version: "8.0" + mongodb-version: "6.0" topology: "sharded_cluster" steps: From fcc8ae8f211ad8ec53e1cb468bfa85e124b81144 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 7 Jul 2025 14:10:31 +0200 Subject: [PATCH 2/4] Report test results and coverage to codecov --- .github/actions/setup/action.yml | 4 ++-- .github/workflows/tests.yml | 19 ++++++++++++++++++- phpunit.evergreen.xml | 12 ++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index c66c0fa8f..5e51b6b2b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -23,7 +23,7 @@ runs: uses: shivammathur/cache-extensions@v1 with: php-version: ${{ inputs.php-version }} - extensions: "mongodb-${{ inputs.driver-version }}" + extensions: "xdebug,mongodb-${{ inputs.driver-version }}" key: "extcache-${{ inputs.driver-version }}" - name: Cache extensions @@ -37,7 +37,7 @@ runs: uses: shivammathur/setup-php@v2 with: coverage: none - extensions: "mongodb-${{ inputs.driver-version }}" + extensions: "xdebug,mongodb-${{ inputs.driver-version }}" php-version: "${{ inputs.php-version }}" tools: cs2pr ini-values: "${{ inputs.php-ini-values }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2fd58f183..9e001d1c5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -83,6 +83,23 @@ jobs: php-ini-values: "zend.assertions=1" - name: "Run PHPUnit" - run: "vendor/bin/phpunit" + run: "vendor/bin/phpunit --configuration phpunit.evergreen.xml" env: + XDEBUG_MODE: "coverage" MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }} + + - name: "Upload coverage report" + uses: codecov/codecov-action@v5 + with: + disable_search: true + files: coverage.xml + flags: "${{ matrix.mongodb-version }}-${{ matrix.topology }}" + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Upload test results to Codecov + uses: codecov/test-results-action@v1 + with: + disable_search: true + files: test-results.xml + flags: "${{ matrix.mongodb-version }}-${{ matrix.topology }}" + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/phpunit.evergreen.xml b/phpunit.evergreen.xml index b2e71bda3..742d841b1 100644 --- a/phpunit.evergreen.xml +++ b/phpunit.evergreen.xml @@ -25,6 +25,18 @@ + + + src + + + + + + + + + From 1ad87f9c6116b555cb25dd681d574b0d2ee4e415 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 7 Jul 2025 14:33:09 +0200 Subject: [PATCH 3/4] Configure coverage reporting for GitHub Actions only --- .github/workflows/tests.yml | 2 +- phpunit.evergreen.xml | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9e001d1c5..59226167d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -83,7 +83,7 @@ jobs: php-ini-values: "zend.assertions=1" - name: "Run PHPUnit" - run: "vendor/bin/phpunit --configuration phpunit.evergreen.xml" + run: "vendor/bin/phpunit --configuration phpunit.evergreen.xml --coverage-clover coverage.xml" env: XDEBUG_MODE: "coverage" MONGODB_URI: ${{ steps.setup-mongodb.outputs.cluster-uri }} diff --git a/phpunit.evergreen.xml b/phpunit.evergreen.xml index 742d841b1..42a1bfb41 100644 --- a/phpunit.evergreen.xml +++ b/phpunit.evergreen.xml @@ -31,12 +31,6 @@ - - - - - - From 580ff5dc59045223a0a94a2b6e08a60f2b0d7127 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 9 Jul 2025 11:29:18 +0200 Subject: [PATCH 4/4] Fix xdebug coverage setup --- .github/actions/setup/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 5e51b6b2b..e6c8bc090 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -23,7 +23,7 @@ runs: uses: shivammathur/cache-extensions@v1 with: php-version: ${{ inputs.php-version }} - extensions: "xdebug,mongodb-${{ inputs.driver-version }}" + extensions: "mongodb-${{ inputs.driver-version }}" key: "extcache-${{ inputs.driver-version }}" - name: Cache extensions @@ -36,8 +36,8 @@ runs: - name: Install PHP uses: shivammathur/setup-php@v2 with: - coverage: none - extensions: "xdebug,mongodb-${{ inputs.driver-version }}" + coverage: xdebug + extensions: "mongodb-${{ inputs.driver-version }}" php-version: "${{ inputs.php-version }}" tools: cs2pr ini-values: "${{ inputs.php-ini-values }}"