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>
This commit is contained in:
Gregory Anders
2023-11-02 11:12:38 -07:00
committed by GitHub
parent 363e029e7a
commit e0d97d264f
3 changed files with 4 additions and 11 deletions

View File

@ -15,19 +15,14 @@ jobs:
contents: write contents: write
pull-requests: write pull-requests: write
steps: steps:
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update
./.github/scripts/install_deps.sh ./.github/scripts/install_deps.sh
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack sudo apt-get install -y doxygen python3-msgpack
- uses: ./.github/actions/cache
- name: Generate docs - name: Generate docs
id: docs
run: | run: |
make doc make doc
printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
@ -35,7 +30,6 @@ jobs:
- name: FAIL, PR has not committed doc changes - name: FAIL, PR has not committed doc changes
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }} if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
run: | run: |
echo "Job failed, run ./scripts/gen_vimdoc.py and/or ./scripts/gen_vimfn_types.lua" echo "Job failed, run 'make doc' and commit your doc changes."
echo "and commit your doc changes"
echo "The doc generation produces the following changes:" echo "The doc generation produces the following changes:"
git diff --color --exit-code git diff --color --exit-code

View File

@ -1,4 +1,3 @@
#!/usr/bin/env -S nvim -l
-- Generator for various vimdoc and Lua type files -- Generator for various vimdoc and Lua type files
local DEP_API_METADATA = 'build/api_metadata.mpack' local DEP_API_METADATA = 'build/api_metadata.mpack'

View File

@ -928,7 +928,7 @@ set(GEN_EVAL_FILES
add_custom_command( add_custom_command(
OUTPUT ${GEN_EVAL_FILES} OUTPUT ${GEN_EVAL_FILES}
COMMAND ${PROJECT_SOURCE_DIR}/scripts/gen_eval_files.lua COMMAND $<TARGET_FILE:nvim> -l ${PROJECT_SOURCE_DIR}/scripts/gen_eval_files.lua
DEPENDS DEPENDS
${API_METADATA} ${API_METADATA}
${PROJECT_SOURCE_DIR}/scripts/gen_eval_files.lua ${PROJECT_SOURCE_DIR}/scripts/gen_eval_files.lua