You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lint-php.yml 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #
  6. # SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
  7. # SPDX-License-Identifier: MIT
  8. name: Lint php
  9. on:
  10. pull_request:
  11. permissions:
  12. contents: read
  13. concurrency:
  14. group: lint-php-${{ github.head_ref || github.run_id }}
  15. cancel-in-progress: true
  16. jobs:
  17. changes:
  18. runs-on: ubuntu-latest-low
  19. outputs:
  20. src: ${{ steps.changes.outputs.src}}
  21. steps:
  22. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  23. id: changes
  24. continue-on-error: true
  25. with:
  26. filters: |
  27. src:
  28. - '.github/workflows/**'
  29. - '3rdparty/**'
  30. - '**/lib/**'
  31. - '**/tests/**'
  32. - '**/vendor-bin/**'
  33. - '.php-cs-fixer.dist.php'
  34. - 'composer.json'
  35. - 'composer.lock'
  36. - '**.php'
  37. lint:
  38. runs-on: ubuntu-latest
  39. needs: changes
  40. if: needs.changes.outputs.src != 'false'
  41. strategy:
  42. matrix:
  43. php-versions: [ "8.1", "8.2", "8.3" ]
  44. name: php-lint
  45. steps:
  46. - name: Checkout
  47. uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
  48. - name: Set up php ${{ matrix.php-versions }}
  49. uses: shivammathur/setup-php@c665c7a15b5295c2488ac8a87af9cb806cd72198 # v2
  50. with:
  51. php-version: ${{ matrix.php-versions }}
  52. coverage: none
  53. ini-file: development
  54. env:
  55. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  56. - name: Lint
  57. run: composer run lint
  58. summary:
  59. permissions:
  60. contents: none
  61. runs-on: ubuntu-latest-low
  62. needs: [changes, lint]
  63. if: always()
  64. name: php-lint-summary
  65. steps:
  66. - name: Summary status
  67. run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi