1
0

static-code-analysis.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. name: Psalm static code analysis
  2. on:
  3. pull_request:
  4. push:
  5. branches:
  6. - master
  7. - stable*
  8. jobs:
  9. static-code-analysis:
  10. runs-on: ubuntu-latest
  11. if: ${{ github.repository_owner != 'nextcloud-gmbh' }}
  12. steps:
  13. - name: Checkout
  14. uses: actions/checkout@v3
  15. with:
  16. submodules: true
  17. - name: Set up php
  18. uses: shivammathur/setup-php@v2
  19. with:
  20. php-version: '8.0'
  21. extensions: apcu,ctype,curl,dom,fileinfo,ftp,gd,intl,json,ldap,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
  22. coverage: none
  23. env:
  24. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  25. - name: Composer install
  26. run: composer i
  27. - name: Psalm
  28. run: composer run psalm:ci -- --monochrome --no-progress --output-format=github --update-baseline --report=results.sarif
  29. - name: Show potential changes in Psalm baseline
  30. if: always()
  31. run: git diff -- . ':!lib/composer'
  32. - name: Upload Analysis results to GitHub
  33. if: always()
  34. uses: github/codeql-action/upload-sarif@v2
  35. with:
  36. sarif_file: results.sarif
  37. static-code-analysis-security:
  38. runs-on: ubuntu-latest
  39. steps:
  40. - name: Checkout code
  41. uses: actions/checkout@v3
  42. with:
  43. submodules: true
  44. - name: Set up php
  45. uses: shivammathur/setup-php@master
  46. with:
  47. php-version: '8.0'
  48. extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
  49. coverage: none
  50. - name: Composer install
  51. run: composer i
  52. - name: Psalm taint analysis
  53. run: composer run psalm:ci -- --monochrome --no-progress --output-format=github --report=results.sarif --taint-analysis
  54. - name: Upload Security Analysis results to GitHub
  55. if: always()
  56. uses: github/codeql-action/upload-sarif@v2
  57. with:
  58. sarif_file: results.sarif
  59. static-code-analysis-ocp:
  60. runs-on: ubuntu-latest
  61. steps:
  62. - name: Checkout
  63. uses: actions/checkout@v3
  64. with:
  65. submodules: true
  66. - name: Set up php
  67. uses: shivammathur/setup-php@v2
  68. with:
  69. php-version: '8.0'
  70. extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
  71. coverage: none
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. - name: Composer install
  75. run: composer i
  76. - name: Psalm
  77. run: composer run psalm:ci -- -c psalm-ocp.xml --monochrome --no-progress --output-format=github --update-baseline
  78. - name: Show potential changes in Psalm baseline
  79. if: always()
  80. run: git diff -- . ':!lib/composer'