Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actions: Enforce that the rendered copy of the man page is in sync
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# This file is part of git-big-picture | ||
# | ||
# Copyright (C) 2020 Sebastian Pipping <sebastian@pipping.org> | ||
# | ||
# git-big-picture is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# git-big-picture is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with git-big-picture. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
name: Enforce man page in sync | ||
|
||
on: | ||
- pull_request | ||
- push | ||
|
||
jobs: | ||
run_pre_commit: | ||
name: Check if the man page is in sync | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2.2.1 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install build dependencies | ||
run: | | ||
sudo apt-get install --no-install-recommends -y help2man | ||
- name: Install git-big-picture entry point script | ||
run: |- | ||
pip install \ | ||
--disable-pip-version-check \ | ||
--user \ | ||
--no-warn-script-location \ | ||
. | ||
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}" | ||
- name: Check if the man page is in sync with --help output | ||
run: |- | ||
./generate-man-page.sh > git-big-picture.1 | ||
git diff --exit-code git-big-picture.1 | ||
- name: Check if the readme is in sync with --help output | ||
run: |- | ||
diff -U0 <(./extract-usage-from-readme.sh) <(git-big-picture --help) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#! /usr/bin/env bash | ||
# This file is part of git-big-picture | ||
# | ||
# Copyright (C) 2020 Sebastian Pipping <sebastian@pipping.org> | ||
# | ||
# git-big-picture is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# git-big-picture is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with git-big-picture. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
fgrep -A55 usage: README.rst | sed 's,^ ,,' |