run-tests.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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, 7.3, 7.2]
  13. laravel: [7.*]
  14. dependency-version: [prefer-lowest, prefer-stable]
  15. os: [ubuntu-latest, windows-latest]
  16. include:
  17. - laravel: 7.*
  18. testbench: 5.*
  19. name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
  20. steps:
  21. - name: Checkout code
  22. uses: actions/checkout@v1
  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
  28. coverage: none
  29. - name: Install dependencies
  30. run: |
  31. composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
  32. composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
  33. - name: Execute tests
  34. run: vendor/bin/phpunit
  35. - name: Send Slack notification
  36. uses: 8398a7/action-slack@v2
  37. if: failure()
  38. with:
  39. status: ${{ job.status }}
  40. author_name: ${{ github.actor }}
  41. env:
  42. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
  43. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  44. js-tests:
  45. runs-on: ubuntu-latest
  46. name: JavaScript tests
  47. steps:
  48. - name: Checkout code
  49. uses: actions/checkout@v1
  50. - name: Install dependencies
  51. run: yarn install --non-interactive
  52. - name: Execute tests
  53. run: yarn run jest
  54. - name: Send Slack notification
  55. uses: 8398a7/action-slack@v2
  56. if: failure()
  57. with:
  58. status: ${{ job.status }}
  59. author_name: ${{ github.actor }}
  60. env:
  61. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
  62. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}