| 1 | name: Docs CI |
| 2 | |
| 3 | ### Run on *EVERY* .v or .md related commit. |
| 4 | ### The documentation *SHOULD* stay valid, and the developers should receive |
| 5 | ### early warning, if they break it. |
| 6 | |
| 7 | on: |
| 8 | push: |
| 9 | branches: |
| 10 | - master |
| 11 | paths-ignore: |
| 12 | - '**.yml' |
| 13 | - '!**/docs_ci.yml' |
| 14 | - 'cmd/tools/vrepl.v' |
| 15 | pull_request: |
| 16 | paths-ignore: |
| 17 | - '**.yml' |
| 18 | - '!**/docs_ci.yml' |
| 19 | - 'cmd/tools/vrepl.v' |
| 20 | |
| 21 | concurrency: |
| 22 | group: docs-${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }} |
| 23 | cancel-in-progress: true |
| 24 | |
| 25 | jobs: |
| 26 | check-markdown: |
| 27 | runs-on: ubuntu-24.04 |
| 28 | timeout-minutes: 20 |
| 29 | steps: |
| 30 | - uses: actions/checkout@v6 |
| 31 | - uses: ./.github/actions/cache-apt-packages-action |
| 32 | - name: Build V |
| 33 | run: make |
| 34 | - name: Install dependencies (some examples show how to use sqlite and the x11 clipboard) |
| 35 | run: ./v retry -- sudo apt install --quiet -y libx11-dev libssl-dev sqlite3 libsqlite3-dev |
| 36 | - name: Check markdown line length & code examples |
| 37 | run: ./v check-md -hide-warnings . |
| 38 | ## NB: -hide-warnings is used here, so that the output is less noisy, |
| 39 | ## thus real errors are easier to spot. |
| 40 | |
| 41 | report-missing-fn-doc: |
| 42 | runs-on: ubuntu-24.04 |
| 43 | timeout-minutes: 5 |
| 44 | env: |
| 45 | MOPTIONS: --diff --deprecated --relative-paths --exclude /vlib/v/ --exclude /vlib/v2/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/ --exclude /vlib/sokol/ --exclude /vlib/x/ |
| 46 | steps: |
| 47 | - uses: actions/checkout@v6 |
| 48 | - name: Build V |
| 49 | run: make |
| 50 | |
| 51 | - name: Checkout previous v |
| 52 | uses: actions/checkout@v6 |
| 53 | with: |
| 54 | repository: vlang/v |
| 55 | ref: master |
| 56 | path: pv |
| 57 | |
| 58 | - name: Check against parent commit |
| 59 | run: | |
| 60 | # shellcheck disable=SC2086 |
| 61 | ./v missdoc $MOPTIONS pv/vlib vlib |
| 62 | |
| 63 | report-missing-dots-in-doc-comments: |
| 64 | runs-on: ubuntu-24.04 |
| 65 | timeout-minutes: 20 |
| 66 | steps: |
| 67 | - uses: actions/checkout@v6 |
| 68 | - name: Build V |
| 69 | run: make |
| 70 | - name: Check doc comment dots for some key modules |
| 71 | run: ./v run cmd/tools/find_doc_comments_with_no_dots.v \ |
| 72 | vlib/builtin/ vlib/arrays/ vlib/flag/ \ |
| 73 | vlib/bitfield/ vlib/term/ vlib/strings/ \ |
| 74 | vlib/rand/ vlib/compress/ vlib/clipboard/ \ |
| 75 | vlib/time/ \ |
| 76 | vlib/os |
| 77 | |
| 78 | report-wrong-examples-in-doc-comments: |
| 79 | runs-on: ubuntu-24.04 |
| 80 | timeout-minutes: 20 |
| 81 | steps: |
| 82 | - uses: actions/checkout@v6 |
| 83 | - name: Build V |
| 84 | run: make |
| 85 | - name: Check examples in the doc comments for all vlib modules |
| 86 | run: VJOBS=1 ./v doc -check-examples -f none vlib/ |
| 87 | |