summaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2021-02-24 21:44:51 -0500
committerGitHub <noreply@github.com>2021-02-24 21:44:51 -0500
commit55ab5c77a54e0545eb09f4076ac0f2408752674c (patch)
tree6bbe3903083f35f587d4b7eb804cf2d2763c44f5 /.github/workflows
parent8b3d08d7a6e8eccc2997ccbf91a7e12d506196e5 (diff)
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 <Simon-Hauser@outlook.de> Co-authored-by: Github Actions <actions@github>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/docgen.yml70
1 files changed, 70 insertions, 0 deletions
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})