From 1c0ab3749c05fc8122d4e64d41e5c0b74f5109bc Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 26 Jun 2026 21:21:10 +0000 Subject: [PATCH 1/2] ci: run doctests for gems that have them --- .github/workflows/ci.yml | 2 +- .toys/ci.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1700f2ded12..5ba0da7f9573 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: - os: ubuntu-latest ruby: "4.0" # (b/515549177): Disabled linkinator globally due to broken external doc links. - task: "--rubocop-toplevel --rubocop --build --yard" + task: "--rubocop-toplevel --rubocop --build --yard --doctest" - os: macos-latest ruby: "4.0" task: "--test" diff --git a/.toys/ci.rb b/.toys/ci.rb index a1cd344821c7..266c92c025cd 100644 --- a/.toys/ci.rb +++ b/.toys/ci.rb @@ -19,14 +19,15 @@ "rubocop", "build", "yard", + "doctest", "linkinator", "acceptance", "conformance", "samples-main", "samples-latest", ].freeze -OPTIONAL_TASKS = ["conformance"].freeze -ISSUE_TASKS = ["bundle", "test", "rubocop", "build", "yard", "linkinator"].freeze +OPTIONAL_TASKS = ["conformance", "doctest"].freeze +ISSUE_TASKS = ["bundle", "test", "rubocop", "build", "yard", "doctest", "linkinator"].freeze FAILURES_REPORT_PATH = "tmp/ci-failures.json" desc "Run CI tasks." From 3a25f9e32e4dd2accb4fd1f45a93d8bf35ffc7de Mon Sep 17 00:00:00 2001 From: Torrey Payne <11740989+torreypayne@users.noreply.github.com> Date: Mon, 24 Aug 2026 15:14:45 +0000 Subject: [PATCH 2/2] feat(ci): add toys doctest tool definition --- .toys/doctest.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .toys/doctest.rb diff --git a/.toys/doctest.rb b/.toys/doctest.rb new file mode 100644 index 000000000000..f0f7423cb036 --- /dev/null +++ b/.toys/doctest.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +desc "Run YARD doctests for this gem" + +include :exec, e: true + +def run + require "bundler" + gem_dir = Dir.pwd + unless File.file?(File.join(gem_dir, "Gemfile")) && File.file?(File.join(gem_dir, "support/doctest_helper.rb")) + puts "No doctests configured for #{File.basename(gem_dir)}." + exit 0 + end + Bundler.with_unbundled_env do + exec ["bundle", "exec", "yard", "--plugin", "doctest", "doctest"] + end +end