1
0

autocheckers.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: MIT
  3. name: Code checkers
  4. on:
  5. pull_request:
  6. permissions:
  7. contents: read
  8. concurrency:
  9. group: autocheckers-${{ github.head_ref || github.run_id }}
  10. cancel-in-progress: true
  11. jobs:
  12. changes:
  13. runs-on: ubuntu-latest-low
  14. outputs:
  15. src: ${{ steps.changes.outputs.src }}
  16. steps:
  17. - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
  18. id: changes
  19. continue-on-error: true
  20. with:
  21. filters: |
  22. src:
  23. - '.github/workflows/**'
  24. - '3rdparty/**'
  25. - '**/appinfo/**'
  26. - '**/lib/**'
  27. - '**/templates/**'
  28. - 'vendor/**'
  29. - 'vendor-bin/**'
  30. - 'composer.json'
  31. - 'composer.lock'
  32. - '**.php'
  33. autocheckers:
  34. runs-on: ubuntu-latest
  35. needs: changes
  36. if: needs.changes.outputs.src != 'false'
  37. strategy:
  38. matrix:
  39. php-versions: ['8.1']
  40. name: PHP checkers
  41. steps:
  42. - name: Checkout server
  43. uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
  44. with:
  45. submodules: true
  46. - name: Set up php ${{ matrix.php-versions }}
  47. uses: shivammathur/setup-php@c541c155eee45413f5b09a52248675b1a2575231 #v2.31.1
  48. with:
  49. php-version: ${{ matrix.php-versions }}
  50. extensions: ctype, json, mbstring
  51. coverage: none
  52. ini-file: development
  53. env:
  54. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  55. - name: Set up dependencies
  56. run: composer i
  57. - name: Check auto loaders
  58. run: bash ./build/autoloaderchecker.sh
  59. - name: Check translations are JSON decodeable
  60. run: php ./build/translation-checker.php
  61. - name: Check translations do not contain triple dot but ellipsis
  62. run: php ./build/triple-dot-checker.php
  63. - name: Check .htaccess does not contain invalid changes
  64. run: php ./build/htaccess-checker.php
  65. - name: Check that all and only expected files are included
  66. run: php ./build/files-checker.php
  67. summary:
  68. permissions:
  69. contents: none
  70. runs-on: ubuntu-latest-low
  71. needs: [changes, autocheckers]
  72. if: always()
  73. name: autocheckers-summary
  74. steps:
  75. - name: Summary status
  76. run: if ${{ needs.changes.outputs.src != 'false' && needs.autocheckers.result != 'success' }}; then exit 1; fi