From nobody Sat Jan 06 23:23:31 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T6xGC4L8wz55mgw; Sat, 6 Jan 2024 23:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T6xGC3pJcz4StZ; Sat, 6 Jan 2024 23:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704583411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmlZ4vxPY1bYlBiD+ftFFRTcHZAfJcxcb/ChnW3aCS8=; b=E80+W8dlqAf/1DsQJMxSuV6OiPqXqi4NakNlDjvf4OIasZteqKKnyxDE53qzlJVuWtpfOP ByYZYq3vYqMddVe4chry36uwlSko/GlfKQq6JUGJ5gDyRhs5KZyNLL3u7DHMCb6xxYHJDt HAafz/Yw9LMzXN5HA1dKGZ6IoS136EikJMQOj0EL9Z2shbTnJGR26om6tMmyWCisMO8oiG BJrkVzussqlLbVwZX9uKnqLTrc10ZeT5uqaVijvuN+p0eoDxyvV5EG5y9b25O/blRnLsR9 SgJujVMh5gQONH+yKWay0niOzwBxku6W697x9DRJHtmzsfoqGJmHuJUDgTaXQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704583411; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BmlZ4vxPY1bYlBiD+ftFFRTcHZAfJcxcb/ChnW3aCS8=; b=UKmUXhkjAvfO1NQTDsZsqmXOXMkKbX5Ug0q1yeXvlzRcydeykwBTiagiXDQSGFJ2H4UbAf 3Gp1GfADdPcihnWGJ8+4lzmg3NxKPGBa7RhGIW2BLhYDuatQPrmaZSHq8ddKbwQ2A9WWXq d0kIrflLB0fBCo/377mZ7BC4wrQAHEhEUbuehe58ANjmZyCGwoUJUQ99syGrcH641RpruA N/GgImMkdxcE5KU+KNV1Kxfl6FHWaNbcxpDe/Mt/Oo+IaHwotZU32btvmzT0ia+2ir/BeC xMgdAEbxxTkYEErEVKCh+58MrluM3NjVc2yb6EnZorzwl6+X9RpFrn6QuVgQrw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704583411; a=rsa-sha256; cv=none; b=tqBISdVCfaWbAWzus1JwPqUDNykbBeVL3rOoOErfyIBvOFTM/yER+VEhetIpZGAWs51XbL tWsPO+KM3h95D06xjF0HBgtxO1oAf+GwRJKezhsny17YLgMsZpQLXU94jmBf0vtEWS24+q bF4f6d4GL2xgeiWB3UiOqEEFM7k3wHMyqsuIfPGVWTE4G5XCiAErkLZZnmAZ+gH9YGqBcE rELjy1sOUcWYONrOYHeH3miO1b/jIDPhTH/7puze33GNrX8dVacHqy4/b3qol5PY8NZB4+ fx3I2sD7lkMNPdj3Lml6JAqvZEQQgaxfJiPudTPcCCfYG84owrse7uwxZbkpWA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T6xGC2tdtz11Xd; Sat, 6 Jan 2024 23:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 406NNVdf067756; Sat, 6 Jan 2024 23:23:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 406NNVSc067753; Sat, 6 Jan 2024 23:23:31 GMT (envelope-from git) Date: Sat, 6 Jan 2024 23:23:31 GMT Message-Id: <202401062323.406NNVSc067753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: dbee52c9d600 - main - Connect my checkstyle9.pl script to a action. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dbee52c9d6009539992b19c649cdfb4352921b61 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=dbee52c9d6009539992b19c649cdfb4352921b61 commit dbee52c9d6009539992b19c649cdfb4352921b61 Author: Warner Losh AuthorDate: 2024-01-06 15:20:17 +0000 Commit: Warner Losh CommitDate: 2024-01-06 23:23:14 +0000 Connect my checkstyle9.pl script to a action. Connect the checkstyle9.pl script to a github action. This will provide feedback to people submitting changes when the style is grossly wrong. And can provide other automated feedback for the commit message in the future. It already catches the github noreply author. It pulls the full repo to do this. Optimizations welcome. After messing with that for a few hours, I decided to punt and commit the slow, working version and let someone else optimize from here. Sponsored by: Netflix --- .github/workflows/style.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 000000000000..a84d32b65c04 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,40 @@ +name: Style Checker + +# Runs my simple style(9) checker on any pushes or pull requests. It could be +# optimized by fetching the pull request head branch back to main revisions and +# running on that. That would reduce the run time from 3-4 minutes down to 30-40 +# seconds. Getting the right series of clone + fetches to get that iteratively +# is proving elusive, so optimizations welcome. + +on: + push: + branches: [ main, 'stable/13', 'stable/14' ] + pull_request: # maybe pull_request_target + branches: [ main ] + types: [ opened, reopened, edited ] + +permissions: + contents: read + +jobs: + build: + name: Style Checker + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Install packages + run: | + sudo apt-get update --quiet || true + sudo apt-get -yq --no-install-suggests --no-install-recommends install perl + - name: Run checker + run: | + sha=$(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) + tools/build/checkstyle9.pl ${sha}..${{ github.event.pull_request.head.sha }}