From 577dc3a7f1524dff6faa9146f8282d4b69fb4fc7 Mon Sep 17 00:00:00 2001 From: Jack Firth Date: Wed, 8 Jul 2026 00:05:34 -0700 Subject: [PATCH 1/3] Skip CI for README-only and .github-only changes The CI workflow ran on every push and pull request, even when the only changes were to the README or files in the .github directory, which can't affect the build or test results. Add paths-ignore filters so CI is skipped when a push or pull request only touches those locations. Fixes #634. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0eb05bd..6b77059 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,16 @@ name: CI -on: [push, pull_request] +# Changes that only touch the README or the .github directory can't affect the build or test +# results, so there's no need to run CI for pull requests and pushes that only modify those files. +on: + push: + paths-ignore: + - README.md + - .github/** + pull_request: + paths-ignore: + - README.md + - .github/** jobs: From 112b6d8e813ed070495f6389de95a3dc6396b158 Mon Sep 17 00:00:00 2001 From: Jack Firth Date: Wed, 8 Jul 2026 00:14:02 -0700 Subject: [PATCH 2/3] Keep "Build and Test" reporting for skipped runs Using paths-ignore skipped the whole CI workflow for README/.github-only changes, but "Build and Test" is a required status check in the repo's ruleset. A required check that never runs is never satisfied, so those pull requests couldn't merge. Instead of skipping the workflow, always run the "Build and Test" job so it reports a status, and gate the expensive build and test steps on a detect-changes job that checks whether anything outside README.md or .github/ changed. The Code Coverage job (not a required check) is skipped entirely in that case. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 69 +++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b77059..defbf86 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,34 +1,73 @@ name: CI -# Changes that only touch the README or the .github directory can't affect the build or test -# results, so there's no need to run CI for pull requests and pushes that only modify those files. -on: - push: - paths-ignore: - - README.md - - .github/** - pull_request: - paths-ignore: - - README.md - - .github/** +on: [push, pull_request] jobs: + # Changes that only touch the README or the .github directory can't affect the build or test + # results. This job detects that situation so the expensive build and test steps below can be + # skipped. Note that the "Build and Test" job itself always runs to completion (reporting success) + # even when there's nothing to build, because it's a required status check and a skipped required + # check blocks pull requests from merging. + detect-changes: + name: Detect relevant changes + runs-on: ubuntu-latest + outputs: + run: ${{ steps.filter.outputs.run }} + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Check whether any files outside README / .github changed + id: filter + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + base="${{ github.event.pull_request.base.sha }}" + head="${{ github.event.pull_request.head.sha }}" + else + base="${{ github.event.before }}" + head="${{ github.sha }}" + fi + # If the base commit isn't available (e.g. a brand new branch), build to be safe. + if ! git cat-file -e "$base" 2>/dev/null; then + echo "Base commit unavailable; running the build." + echo "run=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + changed="$(git diff --name-only "$base" "$head")" + echo "Changed files:" + echo "$changed" + relevant="$(echo "$changed" | grep -vE '^(README\.md|\.github/)' || true)" + if [ -n "$relevant" ]; then + echo "Relevant changes found; running the build." + echo "run=true" >> "$GITHUB_OUTPUT" + else + echo "Only README / .github changes found; skipping the build." + echo "run=false" >> "$GITHUB_OUTPUT" + fi + build-and-test: name: Build and Test runs-on: ubuntu-latest + needs: detect-changes if: ${{ github.event_name == 'pull_request' || github.actor != 'Copilot' }} steps: - - uses: actions/checkout@master - - uses: Bogdanp/setup-racket@v1.5 + - if: needs.detect-changes.outputs.run == 'true' + uses: actions/checkout@master + - if: needs.detect-changes.outputs.run == 'true' + uses: Bogdanp/setup-racket@v1.5 with: version: stable - - run: raco pkg install --batch --auto --link --name resyntax - - run: raco test --drdr --package resyntax + - if: needs.detect-changes.outputs.run == 'true' + run: raco pkg install --batch --auto --link --name resyntax + - if: needs.detect-changes.outputs.run == 'true' + run: raco test --drdr --package resyntax code-coverage: name: Code Coverage runs-on: ubuntu-latest + needs: detect-changes + if: needs.detect-changes.outputs.run == 'true' steps: - uses: actions/checkout@master - uses: Bogdanp/setup-racket@v1.5 From 3b313bcc38dc4f55f2554f96da1f2943cac47a6f Mon Sep 17 00:00:00 2001 From: Jack Firth Date: Wed, 8 Jul 2026 00:19:54 -0700 Subject: [PATCH 3/3] Skip Resyntax Analysis for README/.github-only changes The Resyntax Analysis workflow installs and builds the package in order to analyze changed files, which is just as wasteful as running CI for changes that only touch the README or the .github directory. Add a paths-ignore filter so it's skipped for those pull requests. Unlike "Build and Test", this workflow isn't a required status check, so it can be skipped at the workflow level without blocking merges. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/resyntax-analyze.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/resyntax-analyze.yml b/.github/workflows/resyntax-analyze.yml index 644ee18..e60fd4b 100644 --- a/.github/workflows/resyntax-analyze.yml +++ b/.github/workflows/resyntax-analyze.yml @@ -17,6 +17,13 @@ on: - reopened - synchronize - ready_for_review + # Analyzing changed files requires installing and building the package, so there's no point + # running this for pull requests that only touch the README or the .github directory. Unlike the + # "Build and Test" check, this workflow isn't a required status check, so skipping it entirely is + # safe and won't block merges. + paths-ignore: + - README.md + - .github/** jobs: analyze: