checksrc.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. # This workflow contains checks at the source code level only.
  5. name: Source
  6. 'on':
  7. push:
  8. branches:
  9. - master
  10. - '*/ci'
  11. paths-ignore:
  12. - '**/*.md'
  13. - '.circleci/**'
  14. - 'appveyor.*'
  15. - 'plan9/**'
  16. - 'tests/data/**'
  17. - 'winbuild/**'
  18. pull_request:
  19. branches:
  20. - master
  21. paths-ignore:
  22. - '**/*.md'
  23. - '.circleci/**'
  24. - 'appveyor.*'
  25. - 'plan9/**'
  26. - 'tests/data/**'
  27. - 'winbuild/**'
  28. permissions: {}
  29. jobs:
  30. checksrc:
  31. runs-on: ubuntu-latest
  32. steps:
  33. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  34. with:
  35. persist-credentials: false
  36. name: checkout
  37. - name: check
  38. run: git ls-files -z "*.[ch]" | xargs -0 -n1 ./scripts/checksrc.pl
  39. codespell-cmakelint-pytype-ruff:
  40. runs-on: ubuntu-24.04
  41. steps:
  42. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  43. with:
  44. persist-credentials: false
  45. name: checkout
  46. - name: install
  47. env:
  48. DEBIAN_FRONTEND: noninteractive
  49. run: |
  50. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  51. sudo apt-get update -y
  52. sudo apt-get install -y --no-install-suggests --no-install-recommends \
  53. codespell python3-pip python3-networkx python3-pydot python3-yaml \
  54. python3-toml python3-markupsafe python3-jinja2 python3-tabulate \
  55. python3-typing-extensions python3-libcst python3-impacket \
  56. python3-websockets python3-pytest
  57. python3 -m pip install --break-system-packages cmakelint==1.4.3 pytype==2024.9.13 ruff==0.6.8
  58. - name: spellcheck
  59. run: |
  60. codespell \
  61. --skip scripts/mk-ca-bundle.pl \
  62. --skip src/tool_hugehelp.c \
  63. -I .github/scripts/codespell-ignore.txt \
  64. CMake include m4 scripts src lib
  65. - name: cmakelint
  66. run: scripts/cmakelint.sh
  67. - name: pytype
  68. run: find . -name '*.py' -exec pytype -j auto -k {} +
  69. - name: ruff
  70. run: ruff check --extend-select=B007,B016,C405,C416,COM818,D200,D213,D204,D401,D415,FURB129,N818,PERF401,PERF403,PIE790,PIE808,PLW0127,Q004,RUF010,SIM101,SIM117,SIM118,TRY400,TRY401
  71. reuse:
  72. runs-on: ubuntu-latest
  73. steps:
  74. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  75. with:
  76. persist-credentials: false
  77. name: checkout
  78. - name: REUSE Compliance Check
  79. uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5
  80. miscchecks:
  81. runs-on: ubuntu-24.04
  82. timeout-minutes: 5
  83. steps:
  84. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  85. with:
  86. persist-credentials: false
  87. name: checkout
  88. - name: shellcheck
  89. run: .github/scripts/shellcheck.sh
  90. - name: spacecheck
  91. run: .github/scripts/spacecheck.pl
  92. - name: yamlcheck
  93. run: .github/scripts/yamlcheck.sh
  94. - name: binarycheck
  95. run: .github/scripts/binarycheck.pl
  96. # we allow some extra in source code
  97. - name: badwords
  98. run: |
  99. grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | \
  100. .github/scripts/badwords.pl $(git ls-files -- src lib include)