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

on: [push, pull_request]

jobs:
sig:
runs-on: ubuntu-latest
env:
BUNDLE_WITH: sig
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0"
bundler-cache: true
- name: Run RBS test
run: bundle exec rake rbs:test
16 changes: 16 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: typecheck

on: [push, pull_request]

jobs:
steep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0"
bundler-cache: true
- name: Type check
run: bundle exec rake steep
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ source "https://rubygems.org"
gemspec

gem "rake"
gem "steep"
gem "test-unit"
gem "test-unit-ruby-core"

group :sig do
gem "rbs"
gem "rdoc"
end
23 changes: 23 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
require "bundler/gem_tasks"
require "rake/testtask"
require "tmpdir"

Rake::TestTask.new(:test) do |t|
t.libs << "test/lib"
t.ruby_opts << "-rhelper"
t.test_files = FileList["test/**/test_*.rb"]
end

desc "Type check with Steep"
task :steep do
sh "steep check"
end

namespace :rbs do
Rake::TestTask.new(:test) do |t|
t.libs << "test_sig"
t.ruby_opts << "-rtest_helper"
t.test_files = FileList["test_sig/test_*.rb"]
end

desc "Update public RBS comments from local RDoc"
task :annotate do
Dir.mktmpdir do |tmpdir|
sh "rdoc", "--ri", "--output", "#{tmpdir}/doc", "--root=.", "lib", "doc"
sh "rbs", "annotate", "--no-system", "--no-gems", "--no-site", "--no-home",
"-d", "#{tmpdir}/doc", "sig/net-http.rbs"
end
end
end

task :default => :test
17 changes: 17 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
target :lib do
check "lib"
signature "sig"

library "cgi"
library "open-uri"
library "net-protocol"
library "openssl"
library "resolv"
library "securerandom"
library "socket"
library "strscan"
library "tempfile"
library "timeout"
library "uri"
library "zlib"
end
Loading