Skip to content

Commit

Permalink
build: use built nvim artifact to generate eval files (neovim#25875)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
gpanders and dundargoc authored Nov 2, 2023
1 parent 363e029 commit e0d97d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,21 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: nightly
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
./.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
id: 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 ./scripts/gen_vimdoc.py and/or ./scripts/gen_vimfn_types.lua"
echo "and commit your doc changes"
echo "Job failed, run 'make doc' and commit your doc changes."
echo "The doc generation produces the following changes:"
git diff --color --exit-code
1 change: 0 additions & 1 deletion scripts/gen_eval_files.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env -S nvim -l
-- Generator for various vimdoc and Lua type files

local DEP_API_METADATA = 'build/api_metadata.mpack'
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ set(GEN_EVAL_FILES

add_custom_command(
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
${API_METADATA}
${PROJECT_SOURCE_DIR}/scripts/gen_eval_files.lua
Expand Down

0 comments on commit e0d97d2

Please sign in to comment.