-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (92 loc) · 3.21 KB
/
ruby.yml
File metadata and controls
94 lines (92 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Ruby SDK
on:
push:
branches: ['main']
pull_request:
types: [opened, synchronize]
paths:
- 'sdk/highlight-ruby/**'
- '.github/workflows/ruby.yml'
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
name: Ruby SDK
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ['3.1', '3.3']
defaults:
run:
working-directory: ./sdk/highlight-ruby/highlight
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
ruby-changed:
- 'sdk/highlight-ruby/**'
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install dependencies
run: bundle install
- name: Test
run: bundle exec rake
- name: Rubocop
run: bundle exec rubocop
- name: Publish to RubyGems
if: github.ref == 'refs/heads/main' && matrix.ruby == '3.3' && steps.filter.outputs.ruby-changed == 'true'
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
RUBYGEMS_API_KEY: '${{secrets.RUBYGEMS_API_KEY}}'
e2e:
name: Rails Example App Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./e2e/ruby/rails/demo
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.4'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install dependencies
run: bundle install
- name: Test
run: bundle exec rake
- name: Rubocop
run: bundle exec rubocop
e2e-api-only:
name: Rails API-Only Example App Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./e2e/ruby/rails/api-only
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3.4'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install dependencies
run: bundle install
- name: Test
run: bundle exec rake