tests.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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: ${{ matrix.operating-system }}
  15. strategy:
  16. matrix:
  17. operating-system: [ubuntu-latest, windows-latest, macos-latest]
  18. php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
  19. name: PHP ${{ matrix.php-versions }} unit tests on ${{ matrix.operating-system }}
  20. steps:
  21. - name: Checkout
  22. uses: actions/checkout@v2
  23. - name: Setup PHP
  24. uses: shivammathur/setup-php@v2
  25. with:
  26. php-version: ${{ matrix.php-versions }}
  27. extensions: gd, sqlite3
  28. - name: Remove composer lock
  29. run: rm composer.lock
  30. - name: Setup PHPunit
  31. run: composer install -n
  32. - name: Run unit tests
  33. run: ../vendor/bin/phpunit --no-coverage
  34. working-directory: tst
  35. Mocha:
  36. runs-on: ubuntu-latest
  37. steps:
  38. - name: Checkout
  39. uses: actions/checkout@v2
  40. - name: Setup Node
  41. uses: actions/setup-node@v1
  42. with:
  43. node-version: '12'
  44. - name: Setup Mocha
  45. run: npm install -g mocha
  46. - name: Setup Node modules
  47. run: npm install
  48. working-directory: js
  49. - name: Run unit tests
  50. run: mocha
  51. working-directory: js