php.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: Unit-Tests
  2. on: [push]
  3. jobs:
  4. test:
  5. name: Test on php ${{ matrix.php }}
  6. runs-on: ubuntu-latest
  7. timeout-minutes: 10
  8. strategy:
  9. fail-fast: true
  10. matrix:
  11. php: [8.1, 8.2, 8.3, 8.4]
  12. # os: [ubuntu-latest, macOS-latest] # windows-latest,
  13. steps:
  14. - name: Checkout
  15. uses: actions/checkout@v4
  16. # usage refer https://github.com/shivammathur/setup-php
  17. - name: Setup PHP
  18. timeout-minutes: 5
  19. uses: shivammathur/setup-php@v2
  20. with:
  21. php-version: ${{ matrix.php}}
  22. tools: pecl, php-cs-fixer, phpunit # , phpunit-7.5
  23. extensions: mbstring, dom, fileinfo, openssl, igbinary # , swoole-4.4.19 #optional, setup extensions
  24. ini-values: post_max_size=56M, short_open_tag=On #optional, setup php.ini configuration
  25. coverage: none #optional, setup coverage driver: xdebug, none
  26. - name: Display Env
  27. run: env
  28. - name: Install dependencies
  29. run: |
  30. composer install --no-progress --no-suggest
  31. # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit"
  32. # Docs: https://getcomposer.org/doc/articles/scripts.md
  33. - name: Run test suite
  34. run: phpunit