From 55ab5c77a54e0545eb09f4076ac0f2408752674c Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 24 Feb 2021 21:44:51 -0500 Subject: feat: Add vim docs & generators (#370) * feat: Add vim docs & generators * example of what we could start to do * Docgen CI job * wip * incremental updates. soon good validation * [Actions] Generate Documentation skip-checks: true * pretty cool now * [Actions] Generate Documentation skip-checks: true * make sure telescope is loaded first * Add updates. Maybe this will not delete now? * Add defaults tags as well * :smile: Co-authored-by: Simon Hauser Co-authored-by: Github Actions --- .github/workflows/docgen.yml | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/docgen.yml (limited to '.github') diff --git a/.github/workflows/docgen.yml b/.github/workflows/docgen.yml new file mode 100644 index 0000000..ec7d8c9 --- /dev/null +++ b/.github/workflows/docgen.yml @@ -0,0 +1,70 @@ +name: Generate docs + +on: push + +jobs: + build-sources: + name: Generate docs + runs-on: ubuntu-20.04 + if: github.ref != 'master' + steps: + - uses: actions/checkout@v2 + - run: date +%F > todays-date + - name: Restore cache for today's nightly. + uses: actions/cache@v2 + with: + path: build + key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }} + + - name: Restore cache for tree-sitter + uses: actions/cache@v2 + with: + path: _ts + key: ${{ runner.os }}-ts-${{ hashFiles('todays-date') }} + + - name: Prepare + run: | + test -d build || { + mkdir -p build + wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage + chmod +x nvim.appimage + mv nvim.appimage ./build/nvim + } + test -d _ts || { + # Pining version. Not sure if we should actually do that + mkdir -p _ts + wget https://github.com/tree-sitter/tree-sitter/releases/download/0.17.3/tree-sitter-linux-x64.gz + gzip -d tree-sitter-linux-x64 + chmod +x tree-sitter-linux-x64 + mv tree-sitter-linux-x64 ./_ts/tree-sitter + } + mkdir -p ~/.local/share/nvim/site/pack/vendor/start + git clone --depth 1 https://github.com/tjdevries/tree-sitter-lua ~/.local/share/nvim/site/pack/vendor/start/tree-sitter-lua + ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start + + - name: Build parser + run: | + # We have to build the parser every single time to keep up with parser changes + export PATH="${PWD}/_ts/:${PATH}" + cd ~/.local/share/nvim/site/pack/vendor/start/tree-sitter-lua + mkdir -p build parser + make build_parser + ln -s ../build/parser.so parser/lua.so + cd + + # inspired by nvim-lspconfigs + - name: Generating docs + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMMIT_MSG: | + [Actions] Generate Documentation + skip-checks: true + run: | + export PATH="${PWD}/build/:${PATH}" + git config user.email "actions@github" + git config user.name "Github Actions" + git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git + make docgen + git add doc/ + # Only commit and push if we have changes + git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF}) -- cgit v1.2.3