tests.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Tests
  2. on: [push]
  3. jobs:
  4. Composer:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - name: Checkout
  8. uses: actions/checkout@v2
  9. - name: Validate composer.json and composer.lock
  10. run: composer validate
  11. - name: Install dependencies
  12. run: composer install --prefer-dist --no-progress --no-suggest
  13. PHPunit:
  14. runs-on: ubuntu-latest
  15. strategy:
  16. matrix:
  17. php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
  18. name: PHP ${{ matrix.php-versions }} unit tests on ${{ matrix.operating-system }}
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v2
  22. - name: Setup PHP
  23. uses: shivammathur/setup-php@v2
  24. with:
  25. php-version: ${{ matrix.php-versions }}
  26. extensions: gd, sqlite3
  27. - name: Remove composer lock
  28. run: rm composer.lock
  29. - name: Setup PHPunit
  30. run: composer install -n
  31. - name: Run unit tests
  32. run: ../vendor/bin/phpunit --no-coverage
  33. working-directory: tst
  34. Mocha:
  35. runs-on: ubuntu-latest
  36. steps:
  37. - name: Checkout
  38. uses: actions/checkout@v2
  39. - name: Setup Node
  40. uses: actions/setup-node@v1
  41. with:
  42. node-version: '12'
  43. - name: Setup Mocha
  44. run: npm install -g mocha
  45. - name: Setup Node modules
  46. run: npm install
  47. working-directory: js
  48. - name: Run unit tests
  49. run: mocha
  50. working-directory: js