Skip to content

Commit 50c398a

Browse files
update ruby client ci to complile + test on push
1 parent fa97937 commit 50c398a

File tree

2 files changed

+63
-26
lines changed

2 files changed

+63
-26
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
compile:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Ruby
14+
uses: ruby/setup-ruby@v1
15+
with:
16+
ruby-version: '3.2' # Set to your Ruby version
17+
18+
- name: Install dependencies
19+
run: bundle install --jobs 4 --retry 3
20+
21+
- name: Build gem
22+
run: bundle exec rake build
23+
24+
test:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout repo
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Ruby
32+
uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: '3.2' # Set to your Ruby version
35+
36+
- name: Install dependencies
37+
run: bundle install --jobs 4 --retry 3
38+
39+
- name: Run tests
40+
run: bundle exec rake test # or 'bundle exec rspec' if using RSpec
41+
42+
publish:
43+
needs: [ compile, test ]
44+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout repo
48+
uses: actions/checkout@v3
49+
50+
- uses: ruby/setup-ruby@v1
51+
with:
52+
ruby-version: 2.7
53+
bundler-cache: true
54+
55+
- name: Test gem
56+
run: bundle install && bundle exec rake test
57+
58+
- name: Build and Push Gem
59+
env:
60+
GEM_HOST_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
61+
run: |
62+
gem build merge_ruby_client.gemspec
63+
gem push merge_ruby_client-*.gem --host https://rubygems.org/

.github/workflows/publish.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)