run-tests.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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, 7.1]
  13. dependency-version: [prefer-lowest, prefer-stable]
  14. os: [ubuntu-latest]
  15. name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
  16. steps:
  17. - name: Checkout code
  18. uses: actions/checkout@v1
  19. - name: Setup PHP
  20. uses: shivammathur/setup-php@v1
  21. with:
  22. php-version: ${{ matrix.php }}
  23. extensions: fileinfo, dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
  24. coverage: none
  25. - name: Install dependencies
  26. run: |
  27. composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
  28. - name: Execute tests
  29. run: vendor/bin/phpunit
  30. - name: Send Slack notification
  31. uses: 8398a7/action-slack@v2
  32. if: failure()
  33. with:
  34. status: ${{ job.status }}
  35. author_name: ${{ github.actor }}
  36. env:
  37. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
  38. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}