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
20 changes: 20 additions & 0 deletions .github/workflows/sig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: sig

on: [push, pull_request]

jobs:
sig:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ruby
- name: Install dependencies
run: |
bundle config set with 'sig'
bundle install
- name: Run RBS test, annotate and confirm
run: bundle exec rake rbs:{test,annotate,confirm}
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
run: |
bundle config set without 'sig'
bundle install
- name: Run test
run: rake test
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ source "https://rubygems.org"

gem "rake"
gem "test-unit"

group :sig do
gem "rbs"
gem "rdoc", "<= 6.11"
end
21 changes: 21 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,25 @@ Rake::TestTask.new(:test) do |t|
t.test_files = FileList["test/**/test_*.rb"]
end

namespace :rbs do
task :test do
sh "ruby -I lib test_sig/test_base64.rb"
end

task :annotate do
require "tmpdir"
require "pathname"

Dir.mktmpdir do |tmpdir|
system("rdoc --ri --output #{tmpdir}/doc --root=. lib")
system("rbs annotate --no-system --no-gems --no-site --no-home -d #{tmpdir}/doc sig")
end
end

task :confirm do
puts "Testing if RBS docs are updated with respect to RDoc"
sh "git diff --exit-code sig/"
end
end

task :default => :test
2 changes: 1 addition & 1 deletion base64.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.metadata["source_code_uri"] = spec.homepage
spec.metadata["changelog_uri"] = spec.homepage + "/releases"

spec.files = ["README.md", "BSDL", "COPYING", "LEGAL", "lib/base64.rb"]
spec.files = ["README.md", "BSDL", "COPYING", "LEGAL", "lib/base64.rb", "sig/base64.rbs"]
spec.bindir = "exe"
spec.executables = []
spec.require_paths = ["lib"]
Expand Down
Loading
Loading