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