tests.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
  2. # https://github.com/localheinz/php-library-template/blob/master/.github/workflows/continuous-integration.yml
  3. # https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
  4. on:
  5. pull_request:
  6. push:
  7. branches:
  8. - master
  9. tags:
  10. - "**"
  11. name: "Continuous Integration"
  12. jobs:
  13. tests:
  14. name: "Unit Tests"
  15. runs-on: ubuntu-latest
  16. strategy:
  17. matrix:
  18. php-binary:
  19. - php7.2
  20. - php7.3
  21. # - php7.4
  22. dependencies:
  23. - lowest
  24. # - locked
  25. - highest
  26. steps:
  27. - name: "Checkout"
  28. uses: actions/checkout@v1.1.0
  29. - name: "Install lowest dependencies with composer"
  30. if: matrix.dependencies == 'lowest'
  31. run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest
  32. # - name: "Install locked dependencies with composer"
  33. # if: matrix.dependencies == 'locked'
  34. # run: ${{ matrix.php-binary }} $(which composer) install --no-interaction --no-progress --no-suggest
  35. - name: "Install highest dependencies with composer"
  36. if: matrix.dependencies == 'highest'
  37. run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest
  38. - name: "Run unit tests with phpunit"
  39. run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml