diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index de7399f..f25e745 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -5,7 +5,7 @@ on: [ push, pull_request ] jobs: run: runs-on: ubuntu-latest - + steps: - name: Checkout Actions uses: actions/checkout@v4 @@ -14,33 +14,30 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: '8.2' -# coverage: none - - - name: Setup Composer - uses: php-actions/composer@v6 - - - name: Cache composer dependencies - uses: actions/cache@v4 - with: - path: vendor - key: composer-${{ hashFiles('composer.lock') }} - -# - name: Run composer install -# run: composer install -n --prefer-dist - + coverage: xdebug + + - name: Install Composer Dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + - name: Run psalm run: ./vendor/bin/psalm --shepherd --threads=2 --no-cache --output-format=github - - name: PHPUnit Tests - uses: php-actions/phpunit@v3 - env: - XDEBUG_MODE: coverage - with: - bootstrap: vendor/autoload.php - configuration: phpunit.xml - php_extensions: xdebug - args: tests --coverage-clover ./coverage.xml - + - name: Code Climate Coverage - before build + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter && chmod +x ./cc-test-reporter + ./cc-test-reporter before-build + + - name: Run Tests + run: | + php vendor/bin/phpunit --coverage-clover coverage.xml --configuration phpunit.xml tests + + - name: Code Climate Coverage - Upload and Report + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + run: | + ./cc-test-reporter format-coverage coverage.xml -t clover + ./cc-test-reporter upload-coverage coverage.xml + - name: Upload coverage to Codecov uses: codecov/codecov-action@v4.0.1 with: