Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions .toys/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
17 changes: 17 additions & 0 deletions .toys/doctest.rb
Original file line number Diff line number Diff line change
@@ -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
Loading