diff --git a/.github/workflows/coverage-tests.yml b/.github/workflows/coverage-tests.yml new file mode 100644 index 00000000000..4803960ae18 --- /dev/null +++ b/.github/workflows/coverage-tests.yml @@ -0,0 +1,44 @@ +name: 🔥 Coverage Tests + +on: + pull_request: + +jobs: + + test-coverage: + runs-on: ubuntu-latest + steps: + - uses: shivammathur/setup-php@v2 + with: + php-version: "8.1" + coverage: xdebug + extensions: fileinfo + - uses: actions/checkout@v4 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install Composer Dependencies + run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: Set environment to testing + run: echo "ENV=testing" > .env + + - name: Execute tests (Unit and Feature tests) via PHPUnit with coverage + run: vendor/bin/pest --coverage --coverage-clover clover.xml --log-junit report.xml + + - name: "Publish coverage report to Codecov" + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + - name: Ping statistics server with test results + run: | + curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php + php ping.php "Monorepo Smoke Tests - Coverage" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index fb45f5e146e..fd1d806244e 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -63,42 +63,3 @@ jobs: run: | curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php php ping.php "Monorepo Smoke Tests" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }} - - - test-coverage: - runs-on: ubuntu-latest - steps: - - uses: shivammathur/setup-php@v2 - with: - php-version: "8.1" - coverage: xdebug - extensions: fileinfo - - uses: actions/checkout@v4 - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v4 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install Composer Dependencies - run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - - name: Set environment to testing - run: echo "ENV=testing" > .env - - - name: Execute tests (Unit and Feature tests) via PHPUnit with coverage - run: vendor/bin/pest --coverage --coverage-clover clover.xml --log-junit report.xml - - - name: "Publish coverage report to Codecov" - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Ping statistics server with test results - run: | - curl https://raw.githubusercontent.com/hydephp/develop/6e9d17f31879f4ccda13a3fec4029c9663bccec0/monorepo/scripts/ping-openanalytics-testrunner.php -o ping.php - php ping.php "Monorepo Smoke Tests - Coverage" ${{ secrets.OPENANALYTICS_TOKEN }} ${{ github.ref_name }}