checkdocs.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. # name: checkout
  35. #
  36. # - name: install prereqs
  37. # run: |
  38. # sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  39. # sudo apt-get update -y
  40. # sudo apt-get install -y --no-install-suggests --no-install-recommends \
  41. # python3-proselint
  42. #
  43. # # config file help: https://github.com/amperser/proselint/
  44. # - name: create proselint config
  45. # run: |
  46. # cat <<JSON > $HOME/.proselintrc.json
  47. # {
  48. # "checks": {
  49. # "typography.diacritical_marks": false,
  50. # "typography.symbols": false,
  51. # "annotations.misc": false,
  52. # "security.password": false,
  53. # "misc.annotations": false
  54. # }
  55. # }
  56. # JSON
  57. #
  58. # - name: trim headers off all *.md files
  59. # run: git ls-files -z '*.md' | xargs -0 -n1 .github/scripts/trimmarkdownheader.pl
  60. #
  61. # - name: check prose
  62. # run: git ls-files -z '*.md' | grep -Evz 'CHECKSRC.md|DISTROS.md|curl_mprintf.md|CURLOPT_INTERFACE.md|interface.md' | xargs -0 proselint README
  63. #
  64. # # This is for CHECKSRC and files with aggressive exclamation mark needs
  65. # - name: create second proselint config
  66. # run: |
  67. # cat <<JSON > $HOME/.proselintrc.json
  68. # {
  69. # "checks": {
  70. # "typography.diacritical_marks": false,
  71. # "typography.symbols": false,
  72. # "typography.exclamation": false,
  73. # "lexical_illusions.misc": false,
  74. # "annotations.misc": false
  75. # }
  76. # }
  77. # JSON
  78. #
  79. # - name: check special prose
  80. # run: proselint docs/internals/CHECKSRC.md docs/libcurl/curl_mprintf.md docs/libcurl/opts/CURLOPT_INTERFACE.md docs/cmdline-opts/interface.md
  81. # Docs: https://github.com/marketplace/actions/markdown-link-check
  82. linkcheck:
  83. runs-on: ubuntu-latest
  84. steps:
  85. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  86. name: checkout
  87. - name: trim the cmdline docs markdown files
  88. run: find docs/cmdline-opts -name "*.md" ! -name "_*" ! -name MANPAGE.md -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl
  89. - uses: gaurav-nelson/github-action-markdown-link-check@5c5dfc0ac2e225883c0e5f03a85311ec2830d368 # v1
  90. with:
  91. use-quiet-mode: 'yes'
  92. spellcheck:
  93. runs-on: ubuntu-latest
  94. steps:
  95. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  96. name: checkout
  97. - name: trim all man page *.md files
  98. run: find docs -name "*.md" ! -name "_*" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl
  99. - name: trim libcurl man page *.md files
  100. run: find docs/libcurl \( -name "curl_*.md" -o -name "libcurl*.md" \) -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl
  101. - name: trim libcurl option man page *.md files
  102. run: find docs/libcurl/opts -name "CURL*.md" -print0 | xargs -0 -n1 .github/scripts/cleanspell.pl
  103. - name: trim cmdline docs markdown _*.md files
  104. run: find docs/cmdline-opts -name "_*.md" -print0 | xargs -0 -n1 .github/scripts/cleancmd.pl --no-header
  105. - name: setup the custom wordlist
  106. run: grep -v '^#' .github/scripts/spellcheck.words > wordlist.txt
  107. - name: Check Spelling
  108. uses: rojopolis/spellcheck-github-actions@403efe0642148e94ecb3515e89c767b85a32371a # v0
  109. with:
  110. config_path: .github/scripts/spellcheck.yaml
  111. badwords-synopsis:
  112. runs-on: ubuntu-latest
  113. steps:
  114. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  115. name: checkout
  116. - name: badwords
  117. 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
  118. - name: verify-synopsis
  119. run: .github/scripts/verify-synopsis.pl docs/libcurl/curl*.md
  120. man-examples:
  121. runs-on: ubuntu-latest
  122. steps:
  123. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  124. name: checkout
  125. - name: render nroff versions
  126. run: autoreconf -fi && ./configure --without-ssl --without-libpsl && make -C docs
  127. - name: verify examples
  128. run: .github/scripts/verify-examples.pl docs/libcurl/curl*.3 docs/libcurl/opts/*.3
  129. miscchecks:
  130. runs-on: ubuntu-24.04
  131. timeout-minutes: 5
  132. steps:
  133. - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
  134. name: checkout
  135. - name: spacecheck
  136. run: .github/scripts/spacecheck.pl