tests.yml 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: Laravel PayPal
  2. on: [push, pull_request]
  3. jobs:
  4. paypal:
  5. name: PHP ${{ matrix.php-versions }}
  6. runs-on: ubuntu-latest
  7. strategy:
  8. fail-fast: false
  9. matrix:
  10. php-versions: ['8.0', '8.1', '8.2', '8.3']
  11. include:
  12. - php-versions: '8.0'
  13. continue-on-error: true
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@v2
  17. # with:
  18. # lfs: true
  19. # - name: Checkout LFS objects
  20. # run: git lfs checkout
  21. - name: Setup PHP with Composer and extensions
  22. with:
  23. php-version: ${{ matrix.php-versions }}
  24. uses: shivammathur/setup-php@v2
  25. - name: Get Composer cache directory
  26. id: composercache
  27. run: echo "::set-output name=dir::$(composer config cache-files-dir)"
  28. - name: Cache Composer dependencies
  29. uses: actions/cache@v2
  30. with:
  31. php-version: ${{ matrix.php-versions }}
  32. path: ${{ steps.composercache.outputs.dir }}
  33. key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
  34. restore-keys: ${{ runner.os }}-composer-
  35. - name: Install Composer dependencies
  36. env:
  37. PHP_VERSION: ${{ matrix.php-versions }}
  38. run: composer install --no-progress --prefer-dist --optimize-autoloader $(if [ "$PHP_VERSION" == "8.0" || "$PHP_VERSION" == "8.1" ]; then echo "--ignore-platform-reqs"; fi;)
  39. - name: Run tests for PHP 7.2 to 8.0 with code coverage
  40. if: matrix.php-versions == '7.2' || matrix.php-versions == '7.3' || matrix.php-versions == '7.4' || matrix.php-versions == '8.0'
  41. env:
  42. PHP_VERSION: ${{ matrix.php-versions }}
  43. run: vendor/bin/phpunit $(if [ "$PHP_VERSION" == "7.2" ]; then echo "-c phpunit.xml.dist.php72"; fi;) $(if [ "$PHP_VERSION" == "7.3" ]; then echo "-c phpunit.xml.dist.php8"; fi;) $(if [ "$PHP_VERSION" == "7.4" ]; then echo "-c phpunit.xml.dist.php8"; fi;) $(if [ "$PHP_VERSION" == "8.0" ]; then echo "-c phpunit.xml.dist.php8"; fi;) --coverage-clover build/logs/clover.xml
  44. - name: Install PestPHP
  45. if: matrix.php-versions == '8.1' || matrix.php-versions == '8.2' || matrix.php-versions == '8.3'
  46. env:
  47. PHP_VERSION: ${{ matrix.php-versions }}
  48. run: composer require pestphp/pest --dev --with-all-dependencies
  49. - name: Run tests for PHP 8.1+ with code coverage
  50. if: matrix.php-versions == '8.1' || matrix.php-versions == '8.2' || matrix.php-versions == '8.3'
  51. env:
  52. PHP_VERSION: ${{ matrix.php-versions }}
  53. run: vendor/bin/pest --coverage-clover build/logs/clover.xml
  54. - name: Install PHP Coveralls library
  55. env:
  56. PHP_VERSION: ${{ matrix.php-versions }}
  57. run:
  58. composer global require --dev php-coveralls/php-coveralls
  59. - name: Upload coverage results to Coveralls
  60. env:
  61. PHP_VERSION: ${{ matrix.php-versions }}
  62. COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  63. COVERALLS_PARALLEL: true
  64. COVERALLS_FLAG_NAME: php-${{ matrix.php-versions }}
  65. run:
  66. php-coveralls -v
  67. - name: Upload coverage results to Codecov
  68. uses: codecov/codecov-action@v3
  69. env:
  70. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
  71. coveralls-finish:
  72. needs: [paypal]
  73. runs-on: ubuntu-latest
  74. steps:
  75. - name: Coveralls Finished
  76. uses: coverallsapp/github-action@master
  77. with:
  78. github-token: ${{ secrets.github_token }}
  79. parallel-finished: true