fix: filePath -> uri #412
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
name: Generate docs | |
on: | |
push: | |
branches-ignore: | |
- master | |
jobs: | |
build-sources: | |
name: Generate docs | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
url: https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz | |
steps: | |
- uses: actions/checkout@v3 | |
- run: date +%F > todays-date | |
- name: Restore cache for today's nightly. | |
uses: actions/cache@v3 | |
with: | |
path: _neovim | |
key: ${{ runner.os }}-${{ matrix.url }}-${{ hashFiles('todays-date') }} | |
- name: Cache rust items | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.rustup/ | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Prepare | |
run: | | |
test -d _neovim || { | |
mkdir -p _neovim | |
curl -sL ${{ matrix.url }} | tar xzf - --strip-components=1 -C "${PWD}/_neovim" | |
} | |
mkdir -p ~/.local/share/nvim/site/pack/vendor/start | |
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim | |
git clone 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 | |
echo "${PWD}/_neovim/bin" >> $GITHUB_PATH | |
echo VIM="${PWD}/_neovim/share/nvim/runtime" >> $GITHUB_ENV | |
- name: Run build scripts | |
run: | | |
nvim -l build/init.lua | |
- name: Build parser | |
run: | | |
# We have to build the parser every single time to keep up with parser changes | |
cd ~/.local/share/nvim/site/pack/vendor/start/tree-sitter-lua | |
make dist | |
cd - | |
- name: Generating docs | |
run: | | |
nvim -l scripts/gendocs.lua | |
# inspired by nvim-lspconfigs | |
- name: Update documentation | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COMMIT_MSG: | | |
[docgen] Update doc/sg.txt | |
skip-checks: true | |
run: | | |
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 | |
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}) |