Skip to content

Commit 07aaa27

Browse files
committed
NO-ISSUE Move some CI jobs into tasks in Rakefile for local development
1 parent 7d02467 commit 07aaa27

2 files changed

Lines changed: 49 additions & 9 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,9 @@ jobs:
3030
distribution: 'temurin'
3131
java-version: 17
3232
architecture: x64
33-
- run: python3 generate-code.py
34-
- run: gem install bundler
3533
- run: bundle install
36-
- run: bundle exec rubocop
37-
- run: rake test
38-
- run: bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning
39-
- run: bundle exec rbs collection install
40-
- run: bundle exec rbs -I sig validate
34+
- run: python3 generate-code.py
35+
- run: bundle exec rake ci
4136

4237
pinact:
4338
runs-on: ubuntu-latest

Rakefile

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ task "release", [:remote] => ["build", "release:guard_clean", "release:rubygem_p
1515
puts "Built and pushed gem to RubyGems without pushing to source control."
1616
end
1717

18+
## Development
19+
1820
desc "Run normal tests (exclude no_missing_require_* specs)"
1921
task :test_normal do
2022
sh "bundle exec rspec --exclude-pattern 'spec/line/bot/line_bot_api_gem_spec.rb' --exclude-pattern 'spec/line/bot/line_bot_gem_spec.rb'"
@@ -33,8 +35,51 @@ end
3335
desc "Run all tests in separate processes"
3436
task :test do
3537
Rake::Task[:test_normal].invoke
36-
3738
Rake::Task[:test_line_bot_api].invoke
38-
3939
Rake::Task[:test_line_bot].invoke
4040
end
41+
42+
desc "Validate comment for YARD"
43+
task :validate_yard_comment do
44+
sh "bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning"
45+
end
46+
47+
desc "RBS type check"
48+
task :rbs do
49+
sh "bundle exec rbs collection install"
50+
sh "bundle exec rbs -I sig validate"
51+
end
52+
53+
desc "Run rubocop"
54+
task :rubocop do
55+
sh "bundle exec rubocop"
56+
end
57+
58+
desc "Fix rubocop errors"
59+
task :rubocop_fix do
60+
sh "bundle exec rubocop -A"
61+
end
62+
63+
desc "Check buildable and its contents"
64+
task :build_test do
65+
sh "bundle exec rake build"
66+
sh "tar -xvf pkg/line-bot-api-*.gem"
67+
68+
puts "<<Show the contents of the gem>>"
69+
sh "tar -zxvf data.tar.gz"
70+
71+
puts "<<clean up>>"
72+
sh "rm -rf pkg/"
73+
sh "rm -rf data.tar.gz"
74+
sh "rm -rf checksums.yaml.gz"
75+
sh "rm -rf metadata.gz"
76+
end
77+
78+
desc "Run all tasks for development check and test"
79+
task :ci do
80+
Rake::Task[:test].invoke
81+
Rake::Task[:rubocop].invoke
82+
Rake::Task[:validate_yard_comment].invoke
83+
Rake::Task[:rbs].invoke
84+
Rake::Task[:build_test].invoke
85+
end

0 commit comments

Comments
 (0)