From 286bb1d4bb32511b64f51b970065a35c46868014 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 c4c23ff677..365ca26bf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,3 +33,17 @@ jobs: with: name: pages path: pages.tar.gz + + - 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