File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ jobs :
10+ test :
11+ name : Test (Ruby ${{ matrix.ruby }})
12+ runs-on : ubuntu-latest
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ ruby : ["3.3", "3.4"]
17+ include :
18+ - ruby : head
19+ experimental : true
20+ continue-on-error : ${{ matrix.experimental || false }}
21+ steps :
22+ - uses : actions/checkout@v4
23+ - uses : ruby/setup-ruby@v1
24+ with :
25+ ruby-version : ${{ matrix.ruby }}
26+ bundler-cache : true
27+ - name : Run tests
28+ run : bundle exec rake test
29+
30+ lint :
31+ name : RuboCop
32+ runs-on : ubuntu-latest
33+ steps :
34+ - uses : actions/checkout@v4
35+ - uses : ruby/setup-ruby@v1
36+ with :
37+ ruby-version : " 3.3"
38+ bundler-cache : true
39+ - name : Run RuboCop
40+ run : bundle exec rake rubocop
41+
42+ build :
43+ name : Build Gem
44+ runs-on : ubuntu-latest
45+ needs : [test, lint]
46+ steps :
47+ - uses : actions/checkout@v4
48+ - uses : ruby/setup-ruby@v1
49+ with :
50+ ruby-version : " 3.3"
51+ bundler-cache : true
52+ - name : Build gem
53+ run : gem build ruby_code.gemspec
54+ - name : Verify gem was built
55+ run : ls ruby_code-*.gem
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ publish :
9+ name : Publish to RubyGems
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : read
13+ id-token : write
14+ steps :
15+ - uses : actions/checkout@v4
16+ - uses : ruby/setup-ruby@v1
17+ with :
18+ ruby-version : " 3.3"
19+ bundler-cache : true
20+ - name : Build gem
21+ run : gem build ruby_code.gemspec
22+ - name : Push to RubyGems
23+ run : gem push ruby_code-*.gem
24+ env :
25+ GEM_HOST_API_KEY : ${{ secrets.RUBYGEMS_API_KEY }}
You can’t perform that action at this time.
0 commit comments