2020-10-20 20:14:56 +02:00
|
|
|
name: Docs CI
|
|
|
|
|
2020-11-27 10:52:56 +01:00
|
|
|
### Run on *EVERY* commit. The documentation *SHOULD* stay valid, and
|
|
|
|
### the developers should receive early warning if they break it.
|
|
|
|
on: [push, pull_request]
|
2020-10-20 20:14:56 +02:00
|
|
|
|
|
|
|
jobs:
|
2020-11-18 18:28:28 +01:00
|
|
|
check-markdown:
|
2021-07-19 12:19:03 +02:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-19 09:36:30 +01:00
|
|
|
timeout-minutes: 5
|
2020-10-20 20:14:56 +02:00
|
|
|
steps:
|
2021-07-19 12:26:36 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build V
|
|
|
|
run: make
|
|
|
|
- name: Check markdown line length & code examples
|
|
|
|
run: ./v check-md -hide-warnings .
|
2022-02-08 10:28:50 +01:00
|
|
|
## NB: -hide-warnings is used here, so that the output is less noisy,
|
|
|
|
## thus real errors are easier to spot.
|
2022-02-06 18:52:14 +01:00
|
|
|
|
|
|
|
report-missing-fn-doc:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
timeout-minutes: 5
|
2022-02-08 10:28:50 +01:00
|
|
|
env:
|
|
|
|
MOPTIONS: --no-line-numbers --relative-paths --exclude /vlib/v/ --exclude /builtin/linux_bare/ --exclude /testdata/ --exclude /tests/ vlib/
|
2022-02-06 18:52:14 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Build V
|
|
|
|
run: make
|
|
|
|
|
|
|
|
- name: Checkout previous v
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: vlang/v
|
|
|
|
path: pv
|
|
|
|
|
|
|
|
- name: Check against parent commit
|
|
|
|
run: |
|
2022-02-08 10:28:50 +01:00
|
|
|
./v run cmd/tools/missdoc.v $MOPTIONS | sort > /tmp/n_v.txt
|
|
|
|
cd pv/ && ../v run ../cmd/tools/missdoc.v $MOPTIONS | sort > /tmp/o_v.txt
|
2022-02-06 18:52:14 +01:00
|
|
|
count_new=$(cat /tmp/n_v.txt | wc -l)
|
|
|
|
count_old=$(cat /tmp/o_v.txt | wc -l)
|
|
|
|
echo "new pubs: $count_new | old pubs: $count_old"
|
|
|
|
echo "new head: $(head -n1 /tmp/n_v.txt)"
|
|
|
|
echo "old head: $(head -n1 /tmp/o_v.txt)"
|
|
|
|
if [[ ${count_new} -gt ${count_old} ]]; then
|
2022-02-08 10:28:50 +01:00
|
|
|
echo "The following $((count_new-count_old)) function(s) are introduced with no documentation:"
|
2022-02-06 18:52:14 +01:00
|
|
|
diff /tmp/n_v.txt /tmp/o_v.txt ## diff does exit(1) when files are different
|
|
|
|
fi
|