From 8667fdaa724409489098d42663e389155c398755 Mon Sep 17 00:00:00 2001 From: karser Date: Thu, 3 Dec 2020 21:01:32 +0200 Subject: [PATCH] test sf 4.4, 5.2 --- .github/workflows/code_checks.yaml | 51 ++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/.github/workflows/code_checks.yaml b/.github/workflows/code_checks.yaml index 3f95b7d..61c6eef 100644 --- a/.github/workflows/code_checks.yaml +++ b/.github/workflows/code_checks.yaml @@ -1,19 +1,22 @@ name: Code_Checks on: - pull_request: null push: branches: - master + pull_request: + schedule: + - cron: '0 0 1,16 * *' jobs: - tests: + phpunit: runs-on: ubuntu-latest strategy: matrix: php: ['7.2', '7.4', '8.0'] - - name: PHP ${{ matrix.php }} tests + symfony: ['4.4.*', '5.2.*'] + fail-fast: false + name: PHPUnit (PHP ${{ matrix.php }}) (Symfony ${{ matrix.symfony }}) steps: # basically git clone - uses: actions/checkout@v2 @@ -25,5 +28,41 @@ jobs: coverage: none # disable xdebug, pcov # if we 2 steps like this, we can better see if composer failed or tests - - run: composer install --no-progress - - run: vendor/bin/phpunit + - name: Install dependencies + env: + SYMFONY_REQUIRE: ${{ matrix.symfony }} + run: | + composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main + composer update --prefer-dist --no-interaction --no-suggest + - name: Run tests + run: vendor/bin/phpunit + + code-coverage: + name: Code Coverage + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + coverage: xdebug + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache/files + key: coverage-${{ hashFiles('composer.json') }} + + - name: Install dependencies + run: | + composer update --prefer-dist --no-interaction --no-suggest + - name: Run code coverage + run: vendor/bin/phpunit -v --coverage-text --coverage-clover=coverage.clover + + - name: Send code coverage + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover coverage.clover