From 9bce2549aad58aa2fdf6bac0f83615f0254929c0 Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Thu, 7 Oct 2021 11:37:56 -0400 Subject: [PATCH] [ci] use reusable workflows (#61) --- .github/workflows/ci.yml | 110 +++++---------------------------------- 1 file changed, 13 insertions(+), 97 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c901039..dc52975 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,116 +8,32 @@ on: jobs: tests: - name: PHP ${{ matrix.php }}, SF ${{ matrix.symfony }} - ${{ matrix.versions }} + name: PHP ${{ matrix.php }}, SF ${{ matrix.symfony }} - ${{ matrix.deps }} runs-on: ubuntu-latest strategy: matrix: php: [7.4, 8.0] - versions: [hightest] + deps: [hightest] symfony: [4.4.*, 5.3.*, 5.4.*] include: - php: 7.4 - versions: lowest + deps: lowest symfony: '*' -# - php: 8.0 -# versions: highest -# symfony: '6.0.*' steps: - - name: Checkout code - uses: actions/checkout@v2.3.3 - - - name: Setup PHP - uses: shivammathur/setup-php@2.7.0 - with: - php-version: ${{ matrix.php }} - coverage: none - tools: flex - - - name: Install dependencies - uses: ramsey/composer-install@v1 + - uses: zenstruck/.github@php-test-symfony with: - dependency-versions: ${{ matrix.versions }} - composer-options: --prefer-dist - env: - SYMFONY_REQUIRE: ${{ matrix.symfony }} - - - name: Install PHPUnit - run: vendor/bin/simple-phpunit install - - - name: Test - run: vendor/bin/simple-phpunit -v --exclude-group panther - - - name: Test Panther Browser (Chrome) - run: vendor/bin/simple-phpunit -v --group panther - env: - PANTHER_BROWSER: chrome - -# - name: Test Panther Browser (Firefox) -# run: vendor/bin/simple-phpunit --teamcity --group panther -# env: -# PANTHER_BROWSER: firefox + php: ${{ matrix.php }} + symfony: ${{ matrix.symfony }} + deps: ${{ matrix.deps }} + phpunit: simple-phpunit code-coverage: - name: Code Coverage - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2.3.3 - - - name: Setup PHP - uses: shivammathur/setup-php@2.7.0 - with: - php-version: 7.4 - coverage: xdebug - ini-values: xdebug.mode=coverage - - - name: Install dependencies - uses: ramsey/composer-install@v1 - with: - composer-options: --prefer-dist - - - name: Install PHPUnit - run: vendor/bin/simple-phpunit install - - - name: Test with coverage - run: vendor/bin/simple-phpunit -v --coverage-text --coverage-clover coverage.xml - env: - PANTHER_BROWSER: chrome - - - name: Publish coverage report to Codecov - uses: codecov/codecov-action@v1 - with: - file: ./coverage.xml + uses: zenstruck/.github/.github/workflows/php-coverage-codecov.yml@main + with: + phpunit: simple-phpunit composer-validate: - name: Validate composer.json - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2.3.3 - - - name: Setup PHP - uses: shivammathur/setup-php@2.7.0 - with: - php-version: 7.4 - coverage: none - - - name: Validate composer.json - run: composer validate --strict --no-check-lock + uses: zenstruck/.github/.github/workflows/php-composer-validate.yml@main cs-check: - name: PHP Coding Standards - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2.3.3 - - - name: Setup PHP - uses: shivammathur/setup-php@2.7.0 - with: - php-version: 7.4 - coverage: none - tools: php-cs-fixer - - - name: Check CS - run: php-cs-fixer fix --dry-run --diff + uses: zenstruck/.github/.github/workflows/php-cs-fixer.yml@main