From patchwork Fri Feb 24 22:35:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Timo Wilken X-Patchwork-Id: 47287 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B75F41682F; Fri, 24 Feb 2023 22:37:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CC112162AB for ; Fri, 24 Feb 2023 22:37:11 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVggb-0007Ul-7t; Fri, 24 Feb 2023 17:37:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVggY-0007UM-P2 for guix-patches@gnu.org; Fri, 24 Feb 2023 17:37:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVggY-0002CR-8K for guix-patches@gnu.org; Fri, 24 Feb 2023 17:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVggY-0004I1-4H for guix-patches@gnu.org; Fri, 24 Feb 2023 17:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61773] [PATCH] gnu: Add actionlint. Resent-From: Timo Wilken Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Feb 2023 22:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61773 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61773@debbugs.gnu.org Cc: Timo Wilken X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167727817016426 (code B ref -1); Fri, 24 Feb 2023 22:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 24 Feb 2023 22:36:10 +0000 Received: from localhost ([127.0.0.1]:38474 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVgfi-0004Gs-4H for submit@debbugs.gnu.org; Fri, 24 Feb 2023 17:36:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:46670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVgfg-0004Gh-2X for submit@debbugs.gnu.org; Fri, 24 Feb 2023 17:36:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVgfd-0007Qw-Tw for guix-patches@gnu.org; Fri, 24 Feb 2023 17:36:05 -0500 Received: from mx2.mythic-beasts.com ([2a00:1098:0:82:1000:0:2:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVgfa-0001yb-HW for guix-patches@gnu.org; Fri, 24 Feb 2023 17:36:05 -0500 Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pVgfX-00C4mt-HC; Fri, 24 Feb 2023 22:35:59 +0000 From: Timo Wilken Date: Fri, 24 Feb 2023 23:35:37 +0100 Message-Id: <20230224223537.23194-1-guix@twilken.net> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-BlackCat-Spam-Score: 9 Received-SPF: pass client-ip=2a00:1098:0:82:1000:0:2:1; envelope-from=guix@twilken.net; helo=mx2.mythic-beasts.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Actionlint is a linter for GitHub Action workflow files. * gnu/packages/check.scm (actionlint, go-github-com-robfig-cron-1.2): New variable. * gnu/packages/golang.scm (go-golang.org-x-sync-semaphore): New variable. --- gnu/packages/check.scm | 71 +++++++++++++++++++++++++++++++++++++++++ gnu/packages/golang.scm | 12 +++++++ 2 files changed, 83 insertions(+) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index 0866558ac2..4e907afeb6 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -42,6 +42,7 @@ ;;; Copyright © 2022 Sharlatan Hellseher ;;; Copyright © 2022 jgart ;;; Copyright © 2023 Luis Felipe López Acevedo +;;; Copyright © 2023 Timo Wilken ;;; ;;; This file is part of GNU Guix. ;;; @@ -1028,6 +1029,76 @@ (define-public cpputest but it works for any C/C++ project.") (license license:bsd-3))) +;; Required by actionlint. The version of `go-github-com-robfig-cron' +;; packaged in Guix is newer and changed some error messages, causing +;; unit tests in actionlint to fail. +(define-public go-github-com-robfig-cron-1.2 + (package + (inherit go-github-com-robfig-cron) + (name "go-github-com-robfig-cron") + (version "1.2.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/robfig/cron") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0nv31m3940d9kf38lw2zs4hpj435bdi9mmim098rb3n4l07qrvva")))))) + +(define-public actionlint + (package + (name "actionlint") + (version "1.6.23") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rhysd/actionlint") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "07is4920a40zrl7mfldg0az2pisi7f6dv4vh3ijn3nzb4i7fqbni")))) + (build-system go-build-system) + (arguments + '(#:import-path "github.com/rhysd/actionlint/cmd/actionlint" + #:unpack-path "github.com/rhysd/actionlint" + #:install-source? #f)) + (inputs (list go-github-com-fatih-color + go-github-com-mattn-go-colorable + go-github-com-mattn-go-runewidth + go-github-com-robfig-cron-1.2 + go-golang.org-x-sync-errgroup + go-golang.org-x-sync-semaphore + go-gopkg-in-yaml-v3)) + (native-inputs (list go-github-com-google-go-cmp-cmp)) + (home-page "https://rhysd.github.io/actionlint/") + (synopsis "Static checker for GitHub Actions workflow files") + (description + "actionlint is a static checker for GitHub Actions +workflow files. Features include: + +@itemize +@item Syntax check for workflow files to check unexpected or missing +keys following workflow syntax +@item Strong type check for @code{$@{@{ @}@}} expressions to catch +several semantic errors like access to not existing property, type +mismatches, ... +@item Actions usage check to check that inputs at @code{with:} and +outputs in @code{steps.@{id@}.outputs} are correct +@item Reusable workflow check to check inputs/outputs/secrets of +reusable workflows and workflow calls +@item shellcheck and pyflakes integrations for scripts at @code{run:} +@item Security checks; script injection by untrusted inputs, +hard-coded credentials +@item Other several useful checks; glob syntax validation, +dependencies check for @code{needs:}, runner label validation, cron +syntax validation, ... +@end itemize +") + (license license:expat))) + (define-public python-parameterized (package (name "python-parameterized") diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index c4b6bcd874..7268b661cf 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -39,6 +39,7 @@ ;;; Copyright © 2022 Nicolas Graves ;;; Copyright © 2022 ( ;;; Copyright © 2023 Hilton Chain +;;; Copyright © 2023 Timo Wilken ;;; ;;; This file is part of GNU Guix. ;;; @@ -7409,6 +7410,17 @@ (define-public go-golang.org-x-sync-errgroup (home-page "https://godoc.org/golang.org/x/sync/errgroup") (license license:bsd-3)))) +(define-public go-golang.org-x-sync-semaphore + (package + (inherit go-golang.org-x-sync-errgroup) + (name "go-golang.org-x-sync-semaphore") + (arguments + '(#:import-path "golang.org/x/sync/semaphore" + #:unpack-path "golang.org/x/sync")) + (synopsis "Weighted semaphore implementation in Go") + (description "Weighted semaphore implementation in Go.") + (home-page "https://godoc.org/golang.org/x/sync/semaphore"))) + (define (go-gotest-tools-source version sha256-base32-hash) (origin (method git-fetch)