Aerendir/console-styles-bundle

View on GitHub
.github/workflows/phpunit.yml

Summary

Maintainability
Test Coverage
name: PHPunit

on: [push, pull_request]

jobs:
    phpunit:
        runs-on: ${{ matrix.os }}
        strategy:
            fail-fast: false
            matrix:
                os: [ubuntu-latest]
                php: ['7.4']
        name: PHP ${{ matrix.php }} on ${{ matrix.os }}
        steps:
            - name: Checkout
              uses: actions/checkout@v2

            - name: Setup PHP
              uses: shivammathur/setup-php@2.5.0
              with:
                  php-version: ${{ matrix.php }}
                  coverage: pcov
                  tools: prestissimo
                  extensions: ast

            - name: Install Composer deps
              run: |
                  composer update --no-interaction --no-suggest

            - name: Run PHPunit
              run: |
                  ./vendor/bin/phpunit

            - name: Change paths in clover.xml
              run: |
                  sed -i 's+/home/runner/work/component-console-styles/component-console-styles+/github/workspace+g' ./var/coverage/clover.xml

            - name: Sonarcloud
              uses: sonarsource/sonarcloud-github-action@master
              env:
                  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
                  SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}