checkdocs.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. #
  3. # SPDX-License-Identifier: curl
  4. # This workflow contains tests that operate on documentation files only. Some
  5. # checks modify the source so they cannot be combined into a single job.
  6. name: Docs
  7. 'on':
  8. push:
  9. branches:
  10. - master
  11. - '*/ci'
  12. paths:
  13. - '.github/workflows/checkdocs.yml'
  14. - '.github/scripts/**'
  15. - '**.md'
  16. - 'docs/*'
  17. pull_request:
  18. branches:
  19. - master
  20. paths:
  21. - '.github/workflows/checkdocs.yml'
  22. - '.github/scripts/**'
  23. - '**.md'
  24. - 'docs/*'
  25. concurrency:
  26. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  27. cancel-in-progress: true
  28. permissions: {}
  29. jobs:
  30. # proselint:
  31. # runs-on: ubuntu-latest
  32. # steps:
  33. # - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
  34. # with:
  35. # persist-credentials: false
  36. # name: checkout
  37. #
  38. # - name: install prereqs
  39. # run: |
  40. # sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  41. # sudo apt-get update -y
  42. # sudo apt-get install -y --no-install-suggests --no-install-recommends \
  43. # python3-proselint
  44. #
  45. # # config file help: https://github.com/amperser/proselint/
  46. # - name: create proselint config
  47. # run: |
  48. # cat <<JSON > $HOME/.proselintrc.json
  49. # {
  50. # "checks": {
  51. # "typography.diacritical_marks": false,
  52. # "typography.symbols": false,
  53. # "annotations.misc": false,
  54. # "security.password": false,
  55. # "misc.annotations": false
  56. # }
  57. # }
  58. # JSON
  59. #
  60. # - name: trim headers off all *.md files
  61. # run: git ls-files -z '*.md' | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl
  62. #
  63. # - name: check prose
  64. # run: git ls-files -z '*.md' | grep -Evz 'CHECKSRC.md|DISTROS.md|curl_mprintf.md|CURLOPT_INTERFACE.md|interface.md' | xargs -0 proselint README
  65. #
  66. # # This is for CHECKSRC and files with aggressive exclamation mark needs
  67. # - name: create second proselint config
  68. # run: |
  69. # cat <<JSON > $HOME/.proselintrc.json
  70. # {
  71. # "checks": {
  72. # "typography.diacritical_marks": false,
  73. # "typography.symbols": false,
  74. # "typography.exclamation": false,
  75. # "lexical_illusions.misc": false,
  76. # "annotations.misc": false
  77. # }
  78. # }
  79. # JSON
  80. #
  81. # - name: check special prose
  82. # run: proselint docs/internals/CHECKSRC.md docs/libcurl/curl_mprintf.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md
  83. linkcheck:
  84. runs-on: ubuntu-latest
  85. steps:
  86. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  87. with:
  88. persist-credentials: false
  89. name: checkout
  90. - name: Run mdlinkcheck
  91. run: ./scripts/mdlinkcheck
  92. spellcheck:
  93. runs-on: ubuntu-latest
  94. steps:
  95. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  96. with:
  97. persist-credentials: false
  98. name: checkout
  99. - name: trim all man page *.md files
  100. run: find docs -name "*.md" ! -name "_*" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl
  101. - name: trim libcurl man page *.md files
  102. run: find docs/libcurl \( -name "curl_*.md" -o -name "libcurl*.md" \) -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl
  103. - name: trim libcurl option man page *.md files
  104. run: find docs/libcurl/opts -name "CURL*.md" -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl
  105. - name: trim cmdline docs markdown _*.md files
  106. run: find docs/cmdline-opts -name "_*.md" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl --no-header
  107. - name: setup the custom wordlist
  108. run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
  109. - name: Check Spelling
  110. uses: rojopolis/spellcheck-github-actions@403efe0642148e94ecb3515e89c767b85a32371a # v0
  111. with:
  112. config_path: .github/scripts/spellcheck.yaml
  113. badwords-synopsis:
  114. runs-on: ubuntu-latest
  115. steps:
  116. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  117. with:
  118. persist-credentials: false
  119. name: checkout
  120. - name: badwords
  121. run: .github/scripts/badwords.pl < .github/scripts/badwords.txt docs/*.md docs/libcurl/*.md docs/libcurl/opts/*.md docs/cmdline-opts/*.md docs/TODO docs/KNOWN_BUGS tests/*.md
  122. - name: verify-synopsis
  123. run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md
  124. man-examples:
  125. runs-on: ubuntu-latest
  126. steps:
  127. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  128. with:
  129. persist-credentials: false
  130. name: checkout
  131. - name: render nroff versions
  132. run: autoreconf -fi && ./configure --without-ssl --without-libpsl && make -C docs
  133. - name: verify examples
  134. run: .github/scripts/verify-examples.pl docs/libcurl/curl*.3 docs/libcurl/opts/*.3
  135. miscchecks:
  136. runs-on: ubuntu-24.04
  137. timeout-minutes: 5
  138. steps:
  139. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  140. with:
  141. persist-credentials: false
  142. name: checkout
  143. - name: spacecheck
  144. run: .github/scripts/spacecheck.pl