Merge pull request #117 from zdharma-continuum/ci-zsd

This commit is contained in:
Philipp Schmitt 2021-12-01 09:08:54 +01:00 committed by GitHub
commit 9c73ed01a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 68 additions and 0 deletions

63
.github/workflows/documentation.yaml vendored Normal file
View file

@ -0,0 +1,63 @@
name: 📚 documentation
on: [push, pull_request, workflow_dispatch]
jobs:
zshelldoc:
runs-on: ubuntu-latest
steps:
- name: 📦 Install zshelldoc
run: |
sudo apt-get install -y zsh
git clone https://github.com/zdharma-continuum/zshelldoc.git /tmp/zsd.git
cd /tmp/zsd.git
sudo make install
zsd --help
- name: ♦️ Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
bundler-cache: true
- name: 📄 Install asciidoctor-pdf
run: |
gem install asciidoctor-pdf
- name: 📡 Check out repository
uses: actions/checkout@v2
- name: 👷 Generate zsd
run: |
make doc
- name: 📇 Generate PDF
run: |
make -C doc/zsdoc pdf
- name: 🗄️ Tar doc/
run: |
tar cvzf /tmp/doc.tar.gz doc
- name: ✉️ Upload doc.tar.gz
uses: actions/upload-artifact@v2
with:
name: docs
path: |
/tmp/doc.tar.gz
- name: 🕵️ Check if the zsd docs need to be updated
# NOTE: We need to run git diff twice here since w/o --quiet it's RC
# is always 0. The first is to display the diff output, the second one
# to test whether the diff is empty.
run: |
git --no-pager diff
if git --no-pager diff --quiet
then
echo "✅ The zshelldocs are up to date"
else
{
echo "❌ The zshelldocs in the repo are not up to date"
echo 'Please regenerate them with $ make doc'
} >&2
exit 1
fi

View file

@ -20,6 +20,11 @@ testD:
testE:
make VERBOSE=$(VERBOSE) NODIFF=$(NODIFF) DEBUG=$(DEBUG) OPTDUMP=$(OPTDUMP) OPTS="ignoreclosebraces" -C test test
# Set LC_ALL to avoid having to deal with different locales.
# The generated .adoc files will differ in sorting and or unicode char encoding.
# LC_ALL=C is sadly not an option here since it results in incorrect char
# encoding in some of the files created by zsd.
doc: export LC_ALL=en_US.UTF-8
doc: zinit.zsh zinit-side.zsh zinit-install.zsh zinit-autoload.zsh
rm -rf doc/zsdoc/data doc/zsdoc/*.adoc
# cd is required since zsd outputs to PWD/zsdoc/