From 5ada931c5d5879d0fd2263d8d295cfd51ac0e429 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 10 Apr 2023 23:12:39 +0200 Subject: [PATCH] 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 --- ci/Jenkinsfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 2e421f3a2..fb1c67dcc 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -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:]]*$//') + ''' } } }