checkdocs.yml 4.8 KB

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