Skip to content

Commit

Permalink
Merge pull request #117 from zdharma-continuum/ci-zsd
Browse files Browse the repository at this point in the history
  • Loading branch information
pschmitt committed Dec 1, 2021
2 parents 6b28299 + 95e8f43 commit 9c73ed0
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit 9c73ed0

Please sign in to comment.