From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 646B4C433EF for ; Mon, 21 Feb 2022 14:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378310AbiBUOsZ (ORCPT ); Mon, 21 Feb 2022 09:48:25 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378314AbiBUOr3 (ORCPT ); Mon, 21 Feb 2022 09:47:29 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5643B6304 for ; Mon, 21 Feb 2022 06:47:03 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id w13so9187962wmi.2 for ; Mon, 21 Feb 2022 06:47:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EKrlFz9E89SyDmXih67+BR+4Z2h2uP3Yp3sCtHeWhvA=; b=XyXWRB/2D4Ygyv8HrLGR/NYyOGfrSHYjWdEfeSHUq2vJkzUUQhhJoTEh221Enzv4ZW zDE8l/P4/Rh2xK0oIuSBIhg5VsYOvQJbbV8j2caZ0m+LsIe0H77nA3/RmQ7GgXfCLkpF GiTTifMbCnrDR0YH24JnkXiPgMbBTYSTLfrEpz9y+0wuB0WMcg3sc8WfbXSjUY9n3dFv sB+VWMQcMhJIkqA0pnu6SXx6r9YpdyOJbjPtXOaPq8RlTovJYEFCr8alGT+tcSu6WLvb bpjDAJmjp5Sy7Ctggs+dRAYkKlTWhO+hwnP22+wzo2LYKxwOwoD3DoJI+wz4k/t9Sicy qztQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EKrlFz9E89SyDmXih67+BR+4Z2h2uP3Yp3sCtHeWhvA=; b=awugKn2PQ/M4NkCFzOXcU/iYivVw7Jtz+U9OBlTszVvJA6pXGrsYyShakoklkpCinl Nr2OOKdPmme0ZNv/S/FBLf1gcAmZdXP4WadqD8AawVP2VDBeFh00TJkQ1oGN7RN2lUKz L/AguQhP0DhgFLCYPqex//Fdil0xmRM/knqXQnTxKxb4hR8d+48NaP/EAHvGoAPmVWRi 8RxD02s05wytWtE7Pzo4fsjOxZqFVJyrLEDvb/uOYu1aDMzdcGvb03oyKqaeQIjxz9yc sjlQOZIwBsMMrJhGkIxKPBr7jgQC9A3XVk/PxpW9Z4YK49p4PGSIkg2/NplFgYuBKkIj 9PLg== X-Gm-Message-State: AOAM531rcNEFVygaDm6x3c26j49pfpJlbSngUIrX/11aABHEFalMEwMr TMvlAPuV7gC4g99ofdyJfFxvQYdgPg7tqg== X-Google-Smtp-Source: ABdhPJzEPCd4n6lhlvywy15TeN1XaH4DrD51G4UAwyCEpjis1qPsE68KBQaQWJcgRJhhyYQ2lJZ5IA== X-Received: by 2002:a1c:7216:0:b0:37b:f84d:d56e with SMTP id n22-20020a1c7216000000b0037bf84dd56emr21398999wmc.177.1645454821678; Mon, 21 Feb 2022 06:47:01 -0800 (PST) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id r14sm25071094wrz.84.2022.02.21.06.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 06:47:01 -0800 (PST) From: =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= To: git@vger.kernel.org Cc: Junio C Hamano , Taylor Blau , =?UTF-8?q?SZEDER=20G=C3=A1bor?= , =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= , =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= , Johannes Schindelin , Victoria Dye , Matheus Tavares , Lars Schneider , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Subject: [PATCH 15/25] CI: split up and reduce "ci/test-documentation.sh" Date: Mon, 21 Feb 2022 15:46:27 +0100 Message-Id: X-Mailer: git-send-email 2.35.1.1132.ga1fe46f8690 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the "ci/test-documentation.sh" script to run the bash-specific parts in as one command in the CI job itself, and to run the two "make doc" commands at the top-level. It'll now be obvious from the title of the step if if we failed in the asciidoc or asciidoctor step. Since the "check_unignored_build_artifacts()" function is now only used in "ci/check-unignored-build-artifacts.sh" move that function there. The recipe for the job in ".github/workflows/main.yml" is now a bit verbose because it's effectively the same job twice, with a "make clean" in-between. It would be better for the verbosity to run it via a matrix as done in the alternate approach in [1] does, but then we'd sacrifice overall CPU time for the brevity. It might still be worth doing, but let's go for this simpler approach for now. 1. https://lore.kernel.org/git/patch-v2-6.6-7c423c8283d-20211120T030848Z-avarab@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason --- .github/workflows/main.yml | 16 +++++++++++++- ci/check-unignored-build-artifacts.sh | 10 +++++++++ ci/lib.sh | 10 --------- ci/test-documentation.sh | 31 +++++++++------------------ 4 files changed, 35 insertions(+), 32 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c23a19eac2..92b914f16fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -365,4 +365,18 @@ jobs: steps: - uses: actions/checkout@v2 - run: ci/install-dependencies.sh - - run: ci/test-documentation.sh + - run: ci/lib.sh + - run: make check-docs + - run: "make doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)" + shell: bash + - run: ci/test-documentation.sh AsciiDoc + if: success() + - run: ci/check-unignored-build-artifacts.sh + if: success() + - run: make clean + - run: "make USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.raw >&2)" + shell: bash + - run: ci/test-documentation.sh Asciidoctor + if: success() + - run: ci/check-unignored-build-artifacts.sh + if: success() diff --git a/ci/check-unignored-build-artifacts.sh b/ci/check-unignored-build-artifacts.sh index 56d04b0db9a..0bc04f32804 100755 --- a/ci/check-unignored-build-artifacts.sh +++ b/ci/check-unignored-build-artifacts.sh @@ -5,4 +5,14 @@ . ${0%/*}/lib.sh +check_unignored_build_artifacts () +{ + ! git ls-files --other --exclude-standard --error-unmatch \ + -- ':/*' 2>/dev/null || + { + echo "$(tput setaf 1)error: found unignored build artifacts$(tput sgr0)" + false + } +} + check_unignored_build_artifacts diff --git a/ci/lib.sh b/ci/lib.sh index 05f3dd15e27..fc6ce4d3e04 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -39,16 +39,6 @@ setenv () { fi } -check_unignored_build_artifacts () -{ - ! git ls-files --other --exclude-standard --error-unmatch \ - -- ':/*' 2>/dev/null || - { - echo "$(tput setaf 1)error: found unignored build artifacts$(tput sgr0)" - false - } -} - # GitHub Action doesn't set TERM, which is required by tput setenv TERM ${TERM:-dumb} diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh index 6b5cce03bd7..b8a6a6f664e 100755 --- a/ci/test-documentation.sh +++ b/ci/test-documentation.sh @@ -1,10 +1,12 @@ -#!/usr/bin/env bash +#!/bin/sh # -# Perform sanity checks on documentation and build it. +# Perform sanity checks on "make doc" output and built documentation # . ${0%/*}/lib.sh +generator=$1 + filter_log () { sed -e '/^GIT_VERSION = /d' \ -e "/constant Gem::ConfigMap is deprecated/d" \ @@ -14,28 +16,15 @@ filter_log () { "$1" } -make check-docs - -# Build docs with AsciiDoc -make doc > >(tee stdout.log) 2> >(tee stderr.raw >&2) -cat stderr.raw -filter_log stderr.raw >stderr.log -test ! -s stderr.log -test -s Documentation/git.html -test -s Documentation/git.xml -test -s Documentation/git.1 -grep '