tests.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # https://help.github.com/en/categories/automating-your-workflow-with-github-actions
  2. # https://github.com/ergebnis/php-library-template
  3. # https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
  4. on:
  5. pull_request:
  6. push:
  7. branches:
  8. - main
  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.4
  20. dependencies:
  21. - lowest
  22. - highest
  23. steps:
  24. - name: "Checkout"
  25. uses: actions/checkout@v2
  26. - name: "Install lowest dependencies with composer"
  27. if: matrix.dependencies == 'lowest'
  28. run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest --prefer-lowest
  29. - name: "Install highest dependencies with composer"
  30. if: matrix.dependencies == 'highest'
  31. run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest
  32. - name: "Run unit tests with phpunit"
  33. run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml --no-coverage