diff --git a/.github/workflows/sniffer.yml b/.github/workflows/sniffer.yml deleted file mode 100644 index e9a61e6..0000000 --- a/.github/workflows/sniffer.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Code sniffer -on: - pull_request: - push: - branches: - - master - -jobs: - sniff: - name: Sniff codebase - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install PHP Codesniffer - run: composer global require squizlabs/php_codesniffer - - - name: Check against PSR12 standard - run: | - `composer global config bin-dir --absolute --quiet`/phpcs --standard=PSR12 ./src diff --git a/.github/workflows/standard-test-coverage.yml b/.github/workflows/standard-test-coverage.yml new file mode 100644 index 0000000..73b0bf4 --- /dev/null +++ b/.github/workflows/standard-test-coverage.yml @@ -0,0 +1,80 @@ +name: PSR-12 coding standard, Test, Coverage +on: + pull_request: + push: + branches: + - master + - dev + +jobs: + coding-standard: + name: PSR-12 coding standard + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + + - name: Install PHP code sniffer + run: composer global require squizlabs/php_codesniffer + + - name: Check against PSR12 standard + run: | + `composer global config bin-dir --absolute --quiet`/phpcs --standard=PSR12 ./src + + tests: + needs: coding-standard + name: PHP ${{ matrix.php }} - Guzzle ${{ matrix.guzzle }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: [ 8.0, 8.1, 8.2 ] + guzzle: [ ^6, ^7 ] + promises: [ ^2 ] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json,curl + + - name: Install dependencies + run: composer require guzzlehttp/guzzle:${{ matrix.guzzle }} guzzlehttp/promises:${{ matrix.promises }} --no-interaction --prefer-dist + + - name: Run test suite + run: ./vendor/bin/phpunit --testdox + + coverage: + needs: tests + name: Coverage + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - uses: shivammathur/setup-php@v2 + with: + coverage: pcov + php-version: 8.2 + extensions: json,curl + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist + + - name: Run tests for coverage + run: ./vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Push to Codecov + run: bash <(curl -s https://codecov.io/bash) + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml deleted file mode 100644 index bf0d94e..0000000 --- a/.github/workflows/test-coverage.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Run tests -on: - pull_request: - push: - branches: - - master - -jobs: - tests: - name: PHP ${{ matrix.php }} with Guzzle ${{ matrix.guzzle }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - php: [ 7.1, 7.2, 7.3, 7.4, 8.0 ] - guzzle: [ ^6, ^7 ] - exclude: - - php: 7.1 - guzzle: ^7 - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: json,curl - - - name: Install dependencies - run: composer require guzzlehttp/guzzle:${{ matrix.guzzle }} --no-interaction --prefer-dist - - - name: Run test suite - run: ./vendor/bin/phpunit --testdox --verbose - - coverage: - needs: tests - name: Coverage - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - uses: shivammathur/setup-php@v2 - with: - coverage: pcov - php-version: 8.0 - - - name: Install dependencies - run: composer require laravel/lumen:"^8" --no-interaction --prefer-dist - - - name: Run tests for coverage - run: ./vendor/bin/phpunit --coverage-clover=coverage.xml - - - name: Push to Codecov - run: bash <(curl -s https://codecov.io/bash) - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}