From 11adb5b8219a2526bc838795f2695af048af2f2f Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 3 Jul 2024 22:54:20 +0200 Subject: [PATCH] ci: verify the order of the search results 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 (https://github.com/CloudCannon/pagefind/pull/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 --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd67ed822d..ebc7fce0a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file