From 03642e326d6002293e026f92909b07c6a87e176e Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Wed, 27 Apr 2022 23:06:48 +0300 Subject: [PATCH] CI workflow to ensure README contains usage text --- .github/workflows/help-in-readme.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/help-in-readme.yml diff --git a/.github/workflows/help-in-readme.yml b/.github/workflows/help-in-readme.yml new file mode 100644 index 000000000..b82dad36c --- /dev/null +++ b/.github/workflows/help-in-readme.yml @@ -0,0 +1,18 @@ +--- +name: help-in-readme +on: [push] # yamllint disable-line rule:truthy +jobs: + help-in-readme: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pip install -e . + - name: Verify that README contains output of darker --help + shell: python + run: | + from pathlib import Path + from subprocess import check_output, STDOUT + cmd = ["darker", "--options-for-readme"] + usage = check_output(cmd, stderr=STDOUT, encoding="utf-8") + readme = Path("README.rst").read_text() + assert usage in readme