Repository navigation
105 lines (103 loc) · 4.17 KB
/
Copy pathruby.yml
File metadata and controls
105 lines (103 loc) · 4.17 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
95
96
97
98
99
100
101
102
103
104
105
name: Ruby SDK
on:
push:
branches: ['main']
paths:
- 'sdk/highlight-ruby/**'
- 'e2e/ruby/**'
- '.github/workflows/ruby.yml'
pull_request:
types: [opened, synchronize]
paths:
- 'sdk/highlight-ruby/**'
- 'e2e/ruby/**'
- '.github/workflows/ruby.yml'
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
name: Ruby SDK
runs-on: ubuntu-22.04-8core-32gb
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@4512585405083f25c027a35db413c2b3b9006d50 # v2
id: filter
with:
filters: |
ruby-changed:
- 'sdk/highlight-ruby/**'
- name: Install Ruby
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # 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-22.04-8core-32gb
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@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
with:
ruby-version: '3.3.4'
# bundler-cache implies frozen (deployment) mode. These e2e apps use the local
# launchdarkly-observability gem via `path:`, whose version is bumped by release-please
# without updating Gemfile.lock, so a frozen `bundle install` fails on the version drift.
# Install non-frozen (the "Install dependencies" step below) to absorb the bump.
bundler-cache: false
- name: Install dependencies
run: bundle install
- name: Test
run: bundle exec rake
e2e-api-only:
name: Rails API-Only Example App Tests
runs-on: ubuntu-22.04-8core-32gb
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@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
with:
ruby-version: '3.3.4'
# bundler-cache implies frozen (deployment) mode. These e2e apps use the local
# launchdarkly-observability gem via `path:`, whose version is bumped by release-please
# without updating Gemfile.lock, so a frozen `bundle install` fails on the version drift.
# Install non-frozen (the "Install dependencies" step below) to absorb the bump.
bundler-cache: false
- name: Install dependencies
run: bundle install
- name: Test
run: bundle exec rake