lint-php.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # This workflow is provided via the organization template repository
  2. #
  3. # https://github.com/nextcloud/.github
  4. # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
  5. name: Lint php
  6. on:
  7. pull_request:
  8. push:
  9. branches:
  10. - main
  11. - master
  12. - stable*
  13. permissions:
  14. contents: read
  15. concurrency:
  16. group: lint-php-${{ github.head_ref || github.run_id }}
  17. cancel-in-progress: true
  18. jobs:
  19. php-lint:
  20. runs-on: ubuntu-latest
  21. strategy:
  22. matrix:
  23. php-versions: [ "8.0", "8.1", "8.2" ]
  24. name: php-lint
  25. steps:
  26. - name: Checkout
  27. uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
  28. - name: Set up php ${{ matrix.php-versions }}
  29. uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
  30. with:
  31. php-version: ${{ matrix.php-versions }}
  32. coverage: none
  33. ini-file: development
  34. env:
  35. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  36. - name: Lint
  37. run: composer run lint
  38. summary:
  39. permissions:
  40. contents: none
  41. runs-on: ubuntu-latest
  42. needs: php-lint
  43. if: always()
  44. name: php-lint-summary
  45. steps:
  46. - name: Summary status
  47. run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi