run-tests.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. name: Run tests
  2. on:
  3. push:
  4. pull_request:
  5. schedule:
  6. - cron: '0 0 * * *'
  7. jobs:
  8. php-tests:
  9. runs-on: ${{ matrix.os }}
  10. strategy:
  11. matrix:
  12. php: [7.4, 8.0, 8.1]
  13. laravel: [7.*, 8.*]
  14. dependency-version: [prefer-stable]
  15. os: [ubuntu-latest, windows-latest]
  16. exclude:
  17. - laravel: 7.*
  18. php: 8.1
  19. name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
  20. steps:
  21. - name: Checkout code
  22. uses: actions/checkout@v2
  23. - name: Setup PHP
  24. uses: shivammathur/setup-php@v2
  25. with:
  26. php-version: ${{ matrix.php }}
  27. extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
  28. coverage: none
  29. tools: composer:v2
  30. - name: Install dependencies
  31. run: |
  32. composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
  33. composer update --${{ matrix.dependency-version }} --no-interaction --no-progress
  34. - name: Execute tests
  35. run: vendor/bin/phpunit
  36. - name: Send Slack notification
  37. uses: 8398a7/action-slack@v2
  38. if: failure()
  39. with:
  40. status: ${{ job.status }}
  41. author_name: ${{ github.actor }}
  42. env:
  43. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
  44. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  45. js-tests:
  46. runs-on: ubuntu-latest
  47. name: JavaScript tests
  48. steps:
  49. - name: Checkout code
  50. uses: actions/checkout@v1
  51. - name: Install dependencies
  52. run: yarn install --non-interactive
  53. - name: Execute tests
  54. run: yarn run jest