Skip to content

Commit

Permalink
Update workflow.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas M. Dutra <terremoth@users.noreply.github.com>
  • Loading branch information
terremoth authored Nov 20, 2024
1 parent d9dba29 commit f5e31f3
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [ push, pull_request ]
jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Checkout Actions
uses: actions/checkout@v4
Expand All @@ -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:
Expand Down

0 comments on commit f5e31f3

Please sign in to comment.