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.
 
 
 
 
 
 

100 lines
2.6 KiB

  1. name: Linters
  2. on:
  3. pull_request:
  4. workflow_dispatch:
  5. push:
  6. branches: [ develop ]
  7. permissions:
  8. contents: read
  9. concurrency:
  10. group: commitcheck-xhiveframework-${{ github.event.number }}
  11. cancel-in-progress: true
  12. jobs:
  13. commit-lint:
  14. name: 'Semantic Commits'
  15. runs-on: ubuntu-latest
  16. if: github.event_name == 'pull_request'
  17. steps:
  18. - uses: actions/checkout@v3
  19. with:
  20. fetch-depth: 200
  21. - uses: actions/setup-node@v3
  22. with:
  23. node-version: 16
  24. check-latest: true
  25. - name: Check commit titles
  26. run: |
  27. npm install @commitlint/cli @commitlint/config-conventional
  28. npx commitlint --verbose --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }}
  29. docs-required:
  30. name: 'Documentation Required'
  31. runs-on: ubuntu-latest
  32. if: github.event_name == 'pull_request'
  33. steps:
  34. - name: 'Setup Environment'
  35. uses: actions/setup-python@v4
  36. with:
  37. python-version: '3.10'
  38. - uses: actions/checkout@v3
  39. - name: Validate Docs
  40. env:
  41. PR_NUMBER: ${{ github.event.number }}
  42. run: |
  43. pip install requests --quiet
  44. python $GITHUB_WORKSPACE/.github/helper/documentation.py $PR_NUMBER
  45. linter:
  46. name: 'XhiveFramework Linter'
  47. runs-on: ubuntu-latest
  48. if: github.event_name == 'pull_request'
  49. steps:
  50. - uses: actions/checkout@v3
  51. - uses: actions/setup-python@v4
  52. with:
  53. python-version: '3.10'
  54. - uses: pre-commit/action@v3.0.0
  55. - name: Download Semgrep rules
  56. run: git clone --depth 1 https://github.com/xhiveframework/semgrep-rules.git xhiveframework-semgrep-rules
  57. - name: Run Semgrep rules
  58. run: |
  59. pip install semgrep==0.97.0
  60. semgrep ci --config ./xhiveframework-semgrep-rules/rules --config r/python.lang.correctness
  61. deps-vulnerable-check:
  62. name: 'Vulnerable Dependency Check'
  63. runs-on: ubuntu-latest
  64. steps:
  65. - uses: actions/setup-python@v4
  66. with:
  67. python-version: '3.10'
  68. - uses: actions/checkout@v3
  69. - name: Cache pip
  70. uses: actions/cache@v3
  71. with:
  72. path: ~/.cache/pip
  73. key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
  74. restore-keys: |
  75. ${{ runner.os }}-pip-
  76. ${{ runner.os }}-
  77. - run: |
  78. pip install pip-audit
  79. cd ${GITHUB_WORKSPACE}
  80. sed -i '/dropbox/d' pyproject.toml # Remove dropbox temporarily https://github.com/dropbox/dropbox-sdk-python/pull/456
  81. pip-audit .