checksrc.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. name: checkout
  35. - name: check
  36. run: git ls-files -z "*.[ch]" | xargs -0 -n1 ./scripts/checksrc.pl
  37. codespell-cmakelint-pytype-ruff:
  38. runs-on: ubuntu-24.04
  39. steps:
  40. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  41. name: checkout
  42. - name: install
  43. env:
  44. DEBIAN_FRONTEND: noninteractive
  45. run: |
  46. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  47. sudo apt-get update -y
  48. sudo apt-get install -y --no-install-suggests --no-install-recommends \
  49. codespell python3-pip python3-networkx python3-pydot python3-yaml \
  50. python3-toml python3-markupsafe python3-jinja2 python3-tabulate \
  51. python3-typing-extensions python3-libcst python3-impacket \
  52. python3-websockets python3-pytest
  53. python3 -m pip install --break-system-packages cmakelint==1.4.3 pytype==2024.9.13 ruff==0.6.8
  54. - name: spellcheck
  55. run: |
  56. codespell \
  57. --skip scripts/mk-ca-bundle.pl \
  58. --skip src/tool_hugehelp.c \
  59. -I .github/scripts/codespell-ignore.txt \
  60. CMake include m4 scripts src lib
  61. - name: cmakelint
  62. run: scripts/cmakelint.sh
  63. - name: pytype
  64. run: find . -name '*.py' -exec pytype -j auto -k {} +
  65. - name: ruff
  66. 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
  67. reuse:
  68. runs-on: ubuntu-latest
  69. steps:
  70. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  71. name: checkout
  72. - name: REUSE Compliance Check
  73. uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5
  74. miscchecks:
  75. runs-on: ubuntu-24.04
  76. timeout-minutes: 5
  77. steps:
  78. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  79. name: checkout
  80. - name: shellcheck
  81. run: .github/scripts/shellcheck.sh
  82. - name: spacecheck
  83. run: .github/scripts/spacecheck.pl
  84. - name: yamlcheck
  85. run: .github/scripts/yamlcheck.sh
  86. - name: binarycheck
  87. run: .github/scripts/binarycheck.pl
  88. # we allow some extra in source code
  89. - name: badwords
  90. run: |
  91. grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | \
  92. .github/scripts/badwords.pl $(git ls-files -- src lib include)