tests.yml 1.6 KB

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