tests.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. name: tests
  2. on:
  3. push:
  4. pull_request:
  5. schedule:
  6. - cron: '0 0 * * *'
  7. jobs:
  8. linux_tests:
  9. runs-on: ubuntu-20.04
  10. services:
  11. memcached:
  12. image: memcached:1.6-alpine
  13. ports:
  14. - 11211:11211
  15. mysql:
  16. image: mysql:5.7
  17. env:
  18. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  19. MYSQL_DATABASE: forge
  20. ports:
  21. - 33306:3306
  22. options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
  23. redis:
  24. image: redis:5.0
  25. ports:
  26. - 6379:6379
  27. options: --entrypoint redis-server
  28. dynamodb:
  29. image: amazon/dynamodb-local:latest
  30. ports:
  31. - 8888:8000
  32. strategy:
  33. fail-fast: true
  34. matrix:
  35. php: ['7.3', '7.4', '8.0', '8.1']
  36. stability: [prefer-lowest, prefer-stable]
  37. name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
  38. steps:
  39. - name: Checkout code
  40. uses: actions/checkout@v2
  41. - name: Setup PHP
  42. uses: shivammathur/setup-php@v2
  43. with:
  44. php-version: ${{ matrix.php }}
  45. extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis-phpredis/phpredis@5.3.5, igbinary, msgpack, lzf, zstd, lz4, memcached
  46. ini-values: error_reporting=E_ALL
  47. tools: composer:v2
  48. coverage: none
  49. env:
  50. REDIS_CONFIGURE_OPTS: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4
  51. REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev
  52. - name: Set Minimum PHP 8.0 Versions
  53. uses: nick-invision/retry@v1
  54. with:
  55. timeout_minutes: 5
  56. max_attempts: 5
  57. command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update
  58. if: matrix.php >= 8
  59. - name: Set Minimum PHP 8.1 Versions
  60. uses: nick-invision/retry@v1
  61. with:
  62. timeout_minutes: 5
  63. max_attempts: 5
  64. command: composer require league/commonmark:^2.0.2 phpunit/phpunit:^9.5.8 ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update
  65. if: matrix.php >= 8.1
  66. - name: Install dependencies
  67. uses: nick-invision/retry@v1
  68. with:
  69. timeout_minutes: 5
  70. max_attempts: 5
  71. command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
  72. - name: Execute tests
  73. run: vendor/bin/phpunit --verbose
  74. env:
  75. DB_PORT: ${{ job.services.mysql.ports[3306] }}
  76. DB_USERNAME: root
  77. DYNAMODB_CACHE_TABLE: laravel_dynamodb_test
  78. DYNAMODB_ENDPOINT: "http://localhost:8888"
  79. AWS_ACCESS_KEY_ID: random_key
  80. AWS_SECRET_ACCESS_KEY: random_secret
  81. - name: Store artifacts
  82. uses: actions/upload-artifact@v2
  83. with:
  84. name: logs
  85. path: |
  86. vendor/orchestra/testbench-core/laravel/storage/logs
  87. !vendor/**/.gitignore
  88. windows_tests:
  89. runs-on: windows-2019
  90. strategy:
  91. fail-fast: true
  92. matrix:
  93. php: ['7.3', '7.4', '8.0', '8.1']
  94. stability: [prefer-lowest, prefer-stable]
  95. name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows
  96. steps:
  97. - name: Set git to use LF
  98. run: |
  99. git config --global core.autocrlf false
  100. git config --global core.eol lf
  101. - name: Checkout code
  102. uses: actions/checkout@v2
  103. - name: Setup PHP
  104. uses: shivammathur/setup-php@v2
  105. with:
  106. php-version: ${{ matrix.php }}
  107. extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached
  108. tools: composer:v2
  109. coverage: none
  110. - name: Set Minimum PHP 8.0 Versions
  111. uses: nick-invision/retry@v1
  112. with:
  113. timeout_minutes: 5
  114. max_attempts: 5
  115. command: composer require guzzlehttp/guzzle:^7.2 --no-interaction --no-update
  116. if: matrix.php >= 8
  117. - name: Set Minimum PHP 8.1 Versions
  118. uses: nick-invision/retry@v1
  119. with:
  120. timeout_minutes: 5
  121. max_attempts: 5
  122. command: composer require league/commonmark:^2.0.2 phpunit/phpunit:^9.5.8 --no-interaction --no-update
  123. if: matrix.php >= 8.1
  124. - name: Install dependencies
  125. uses: nick-invision/retry@v1
  126. with:
  127. timeout_minutes: 5
  128. max_attempts: 5
  129. command: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
  130. - name: Execute tests
  131. run: vendor/bin/phpunit --verbose
  132. - name: Store artifacts
  133. uses: actions/upload-artifact@v2
  134. with:
  135. name: logs
  136. path: |
  137. vendor/orchestra/testbench-core/laravel/storage/logs
  138. !vendor/**/.gitignore