neovim/.github/workflows/api-docs.yml
Gregory Anders e0d97d264f
build: use built nvim artifact to generate eval files (#25875)
In cases where the generated files depend on changes to Nvim itself,
generating the files with an older version of Nvim will fail because
those changes are not present in the older version.

For example, if a new option is added then the generator script should
be run with the version of Nvim that contains the new option, or else
the generation will fail.

Co-authored-by: dundargoc <gocdundar@gmail.com>
2023-11-02 11:12:38 -07:00

36 lines
1.0 KiB
YAML

# Check if any PR needs to run the autogenerate script
name: Autogenerate API docs and types
on:
pull_request:
paths:
- 'src/nvim/api/*.[ch]'
- 'src/nvim/eval.lua'
- 'runtime/lua/**.lua'
- 'runtime/doc/**'
jobs:
regen-api-docs-and-types:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
./.github/scripts/install_deps.sh
sudo apt-get install -y doxygen python3-msgpack
- uses: ./.github/actions/cache
- name: Generate docs
run: |
make doc
printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
- name: FAIL, PR has not committed doc changes
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
run: |
echo "Job failed, run 'make doc' and commit your doc changes."
echo "The doc generation produces the following changes:"
git diff --color --exit-code