Skip to content

Commit

Permalink
ci: verify the order of the search results
Browse files Browse the repository at this point in the history
We definitely want the search results for, say, "commit" to show the
manual page of that command first.

This took quite a bit of work to accomplish, including a change to
Pagefind itself (CloudCannon/pagefind#534) as
well as some extensive fiddling with the ranking weights (including, I
kid you not, running a Powell's optimization of the weights).

To ensure that the results are shown in the desired order, let's add an
explicit check for that in the PR builds.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jul 3, 2024
1 parent 839531e commit 11adb5b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,17 @@ jobs:
public/
output: lychee.md
jobSummary: true

- name: verify search results
run: |
set -x
res=0
for term in commit config log rev-parse
do
node ./script/run-pagefind.js "$term" | tee search.results >&2
grep "^1. /docs/git-$term\\.html" search.results || {
echo "::error::Search for $term failed to show the manual page first" >&2
res=1
}
done
exit $res

0 comments on commit 11adb5b

Please sign in to comment.