add CI check for options documentation (#4804)

* add CI check for options documentation

Ensure that documented options reflect available beacon node options.

* escape `\`

* use bash

* override `COLUMNS` for extracting help text
This commit is contained in:
Etan Kissling 2023-04-10 23:12:39 +02:00 committed by GitHub
parent df7ecd4fe9
commit 5ada931c5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

10
ci/Jenkinsfile vendored
View File

@ -60,6 +60,16 @@ pipeline {
stage('Build') {
steps { timeout(40) {
sh 'make LOG_LEVEL=TRACE'
/* Check documentation reflects `nimbus_beacon_node --help`. */
sh '''#!/usr/bin/env bash
diff -u \\
<(sed -n '/Usage/,/^...$/ { /^...$/d; p; }' \\
docs/the_nimbus_book/src/options.md) \\
<(COLUMNS=200 build/nimbus_beacon_node --help | \\
sed -n '/Usage/,/Available sub-commands/ { /Available sub-commands/d; p; }' | \\
sed 's/\\x1B\\[[0-9;]*[mG]//g' | \\
sed 's/[[:space:]]*$//')
'''
} }
}