Skip to content

Commit 0874ca8

Browse files
authored
Apply bundler-cache to CI's Ruby setup (#2204)
* Apply bundler-cache to CI's Ruby setup * Only require debug when the engine is ruby
1 parent bdb2c7b commit 0874ca8

File tree

7 files changed

+148
-117
lines changed

7 files changed

+148
-117
lines changed

.github/workflows/sentry_delayed_job_test.yml

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,40 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222
strategy:
2323
matrix:
24-
ruby_version: [2.4, 2.5, 2.6, 2.7, '3.0', '3.1', '3.2', jruby]
24+
ruby_version: [2.4, 2.5, 2.6, 2.7, "3.0", "3.1", "3.2", jruby]
2525
os: [ubuntu-latest]
2626
include:
27-
- { os: ubuntu-latest, ruby_version: '3.2', options: { rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal" } }
28-
- { os: ubuntu-latest, ruby_version: '3.2', options: { codecov: 1 } }
27+
- {
28+
os: ubuntu-latest,
29+
ruby_version: "3.2",
30+
options:
31+
{
32+
rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal",
33+
},
34+
}
35+
- { os: ubuntu-latest, ruby_version: "3.2", options: { codecov: 1 } }
2936
steps:
30-
- uses: actions/checkout@v1
31-
- name: Install sqlite
32-
run: |
33-
# See https://github.community/t5/GitHub-Actions/ubuntu-latest-Apt-repository-list-issues/td-p/41122/page/2
34-
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
35-
sudo apt-get update
36-
sudo apt-get install libsqlite3-dev
37+
- uses: actions/checkout@v1
38+
- name: Install sqlite
39+
run: |
40+
# See https://github.community/t5/GitHub-Actions/ubuntu-latest-Apt-repository-list-issues/td-p/41122/page/2
41+
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
42+
sudo apt-get update
43+
sudo apt-get install libsqlite3-dev
3744
38-
- name: Set up Ruby ${{ matrix.ruby_version }}
39-
uses: ruby/setup-ruby@v1
40-
with:
41-
ruby-version: ${{ matrix.ruby_version }}
42-
bundler: "2.3"
45+
- name: Set up Ruby ${{ matrix.ruby_version }}
46+
uses: ruby/setup-ruby@v1
47+
with:
48+
ruby-version: ${{ matrix.ruby_version }}
49+
bundler-cache: true
4350

44-
- name: Run specs
45-
env:
46-
RUBYOPT: ${{ matrix.options.rubyopt }}
47-
run: |
48-
bundle install --jobs 4 --retry 3
49-
bundle exec rake
51+
- name: Run specs
52+
env:
53+
RUBYOPT: ${{ matrix.options.rubyopt }}
54+
run: |
55+
bundle install --jobs 4 --retry 3
56+
bundle exec rake
5057
51-
- name: Upload Coverage
52-
if: ${{ matrix.options.codecov }}
53-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
58+
- name: Upload Coverage
59+
if: ${{ matrix.options.codecov }}
60+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d

.github/workflows/sentry_opentelemetry_test.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,36 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222
strategy:
2323
matrix:
24-
ruby_version: [2.6, 2.7, '3.0', '3.1', '3.2', jruby]
24+
ruby_version: [2.6, 2.7, "3.0", "3.1", "3.2", jruby]
2525
# opentelemetry_version: [1.2.0]
2626
os: [ubuntu-latest]
2727
include:
28-
- { os: ubuntu-latest, ruby_version: 3.2, options: { rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal" } }
28+
- {
29+
os: ubuntu-latest,
30+
ruby_version: 3.2,
31+
options:
32+
{
33+
rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal",
34+
},
35+
}
2936
- { os: ubuntu-latest, ruby_version: 3.2, options: { codecov: 1 } }
3037
steps:
31-
- uses: actions/checkout@v1
38+
- uses: actions/checkout@v1
3239

33-
- name: Set up Ruby ${{ matrix.ruby_version }}
34-
uses: ruby/setup-ruby@8ddb7b3348b3951590db24c346e94ebafdabc926
35-
with:
36-
ruby-version: ${{ matrix.ruby_version }}
37-
bundler: "2.3"
40+
- name: Set up Ruby ${{ matrix.ruby_version }}
41+
uses: ruby/setup-ruby@v1
42+
with:
43+
ruby-version: ${{ matrix.ruby_version }}
44+
bundler-cache: true
3845

39-
- name: Run specs
40-
env:
41-
RUBYOPT: ${{ matrix.options.rubyopt }}
42-
OPENTELEMETRY_VERSION: ${{ matrix.opentelemetry_version }}
43-
run: |
44-
bundle install --jobs 4 --retry 3
45-
bundle exec rake
46+
- name: Run specs
47+
env:
48+
RUBYOPT: ${{ matrix.options.rubyopt }}
49+
OPENTELEMETRY_VERSION: ${{ matrix.opentelemetry_version }}
50+
run: |
51+
bundle install --jobs 4 --retry 3
52+
bundle exec rake
4653
47-
- name: Upload Coverage
48-
if: ${{ matrix.options.codecov }}
49-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
54+
- name: Upload Coverage
55+
if: ${{ matrix.options.codecov }}
56+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d

.github/workflows/sentry_rails_test.yml

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
rails_version: [6.1.0, 7.0.0, 7.1.0]
26-
ruby_version: [2.7, '3.0', '3.1', '3.2']
26+
ruby_version: [2.7, "3.0", "3.1", "3.2"]
2727
os: [ubuntu-latest]
2828
include:
2929
- { os: ubuntu-latest, ruby_version: "2.4", rails_version: 5.0.0 }
@@ -61,30 +61,27 @@ jobs:
6161
options: { codecov: 1 },
6262
}
6363
steps:
64-
- uses: actions/checkout@v1
65-
- name: Install sqlite and ImageMagick
66-
run: |
67-
# See https://github.community/t5/GitHub-Actions/ubuntu-latest-Apt-repository-list-issues/td-p/41122/page/2
68-
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
69-
sudo apt-get update
70-
sudo apt-get install libsqlite3-dev imagemagick
71-
- name: Set up Ruby ${{ matrix.ruby_version }}
72-
uses: ruby/setup-ruby@v1
73-
with:
74-
ruby-version: ${{ matrix.ruby_version }}
75-
bundler: "2.3"
76-
# rails 7.1.0 requires latest rubygems
77-
# but 3.5.0 dropped ruby 2.7 so we need to pin to something that works for all our shit
78-
rubygems: ${{ matrix.rails_version == '7.1.0' && '3.4.22' || 'default' }}
64+
- uses: actions/checkout@v1
65+
- name: Install sqlite and ImageMagick
66+
run: |
67+
# See https://github.community/t5/GitHub-Actions/ubuntu-latest-Apt-repository-list-issues/td-p/41122/page/2
68+
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done
69+
sudo apt-get update
70+
sudo apt-get install libsqlite3-dev imagemagick
71+
- name: Set up Ruby ${{ matrix.ruby_version }}
72+
uses: ruby/setup-ruby@v1
73+
with:
74+
ruby-version: ${{ matrix.ruby_version }}
75+
bundler-cache: true
7976

80-
- name: Build with Rails ${{ matrix.rails_version }}
81-
env:
82-
RAILS_VERSION: ${{ matrix.rails_version }}
83-
RUBYOPT: ${{ matrix.options.rubyopt }}
84-
run: |
85-
bundle install --jobs 4 --retry 3
86-
bundle exec rake
77+
- name: Build with Rails ${{ matrix.rails_version }}
78+
env:
79+
RAILS_VERSION: ${{ matrix.rails_version }}
80+
RUBYOPT: ${{ matrix.options.rubyopt }}
81+
run: |
82+
bundle install --jobs 4 --retry 3
83+
bundle exec rake
8784
88-
- name: Upload Coverage
89-
if: ${{ matrix.options.codecov }}
90-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
85+
- name: Upload Coverage
86+
if: ${{ matrix.options.codecov }}
87+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d

.github/workflows/sentry_resque_test.yml

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,38 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222
strategy:
2323
matrix:
24-
ruby_version: [2.4, 2.5, 2.6, 2.7, '3.0', '3.1', '3.2', jruby]
24+
ruby_version: [2.4, 2.5, 2.6, 2.7, "3.0", "3.1", "3.2", jruby]
2525
os: [ubuntu-latest]
2626
include:
27-
- { os: ubuntu-latest, ruby_version: '3.2', options: { rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal" } }
28-
- { os: ubuntu-latest, ruby_version: '3.2', options: { codecov: 1 } }
27+
- {
28+
os: ubuntu-latest,
29+
ruby_version: "3.2",
30+
options:
31+
{
32+
rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal",
33+
},
34+
}
35+
- { os: ubuntu-latest, ruby_version: "3.2", options: { codecov: 1 } }
2936
steps:
30-
- uses: actions/checkout@v1
31-
- name: Set up Ruby ${{ matrix.ruby_version }}
32-
uses: ruby/setup-ruby@v1
33-
with:
34-
ruby-version: ${{ matrix.ruby_version }}
35-
bundler: "2.3"
37+
- uses: actions/checkout@v1
38+
- name: Set up Ruby ${{ matrix.ruby_version }}
39+
uses: ruby/setup-ruby@v1
40+
with:
41+
ruby-version: ${{ matrix.ruby_version }}
42+
bundler-cache: true
3643

37-
- name: Start Redis
38-
uses: supercharge/redis-github-action@1.1.0
39-
with:
40-
redis-version: 5
44+
- name: Start Redis
45+
uses: supercharge/redis-github-action@1.1.0
46+
with:
47+
redis-version: 5
4148

42-
- name: Run specs
43-
env:
44-
RUBYOPT: ${{ matrix.options.rubyopt }}
45-
run: |
46-
bundle install --jobs 4 --retry 3
47-
bundle exec rake
49+
- name: Run specs
50+
env:
51+
RUBYOPT: ${{ matrix.options.rubyopt }}
52+
run: |
53+
bundle install --jobs 4 --retry 3
54+
bundle exec rake
4855
49-
- name: Upload Coverage
50-
if: ${{ matrix.options.codecov }}
51-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
56+
- name: Upload Coverage
57+
if: ${{ matrix.options.codecov }}
58+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d

.github/workflows/sentry_ruby_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222
strategy:
2323
matrix:
24-
ruby_version: [2.4, 2.5, 2.6, 2.7, '3.0', '3.1', '3.2', jruby]
24+
ruby_version: [2.4, 2.5, 2.6, 2.7, "3.0", "3.1", "3.2", jruby]
2525
rack_version: [2.0, 3.0]
2626
redis_rb_version: [4.0]
2727
os: [ubuntu-latest]
@@ -62,7 +62,7 @@ jobs:
6262
uses: ruby/setup-ruby@v1
6363
with:
6464
ruby-version: ${{ matrix.ruby_version }}
65-
bundler: "2.3"
65+
bundler-cache: true
6666

6767
- name: Start Redis
6868
uses: supercharge/redis-github-action@c169aa53af4cd5d9321e9114669dbd11be08d307

.github/workflows/sentry_sidekiq_test.yml

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
runs-on: ${{ matrix.os }}
2222
strategy:
2323
matrix:
24-
sidekiq_version: ['5.0', '6.0', '7.0']
25-
ruby_version: ['2.7', '3.0', '3.1', '3.2', jruby]
24+
sidekiq_version: ["5.0", "6.0", "7.0"]
25+
ruby_version: ["2.7", "3.0", "3.1", "3.2", jruby]
2626
os: [ubuntu-latest]
2727
include:
2828
- { os: ubuntu-latest, ruby_version: 2.4, sidekiq_version: 5.0 }
@@ -33,30 +33,43 @@ jobs:
3333
- { os: ubuntu-latest, ruby_version: jruby, sidekiq_version: 5.0 }
3434
- { os: ubuntu-latest, ruby_version: jruby, sidekiq_version: 6.0 }
3535
- { os: ubuntu-latest, ruby_version: jruby, sidekiq_version: 7.0 }
36-
- { os: ubuntu-latest, ruby_version: '3.2', sidekiq_version: 7.0, options: { rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal" } }
37-
- { os: ubuntu-latest, ruby_version: '3.2', sidekiq_version: 7.0, options: { codecov: 1 } }
36+
- {
37+
os: ubuntu-latest,
38+
ruby_version: "3.2",
39+
sidekiq_version: 7.0,
40+
options:
41+
{
42+
rubyopt: "--enable-frozen-string-literal --debug=frozen-string-literal",
43+
},
44+
}
45+
- {
46+
os: ubuntu-latest,
47+
ruby_version: "3.2",
48+
sidekiq_version: 7.0,
49+
options: { codecov: 1 },
50+
}
3851
steps:
39-
- uses: actions/checkout@v1
52+
- uses: actions/checkout@v1
4053

41-
- name: Set up Ruby ${{ matrix.ruby_version }}
42-
uses: ruby/setup-ruby@v1
43-
with:
44-
ruby-version: ${{ matrix.ruby_version }}
45-
bundler: "2.3"
54+
- name: Set up Ruby ${{ matrix.ruby_version }}
55+
uses: ruby/setup-ruby@v1
56+
with:
57+
ruby-version: ${{ matrix.ruby_version }}
58+
bundler-cache: true
4659

47-
- name: Start Redis
48-
uses: supercharge/redis-github-action@1.1.0
49-
with:
50-
redis-version: ${{ matrix.sidekiq_version == '7.0' && 6 || 5 }}
60+
- name: Start Redis
61+
uses: supercharge/redis-github-action@1.1.0
62+
with:
63+
redis-version: ${{ matrix.sidekiq_version == '7.0' && 6 || 5 }}
5164

52-
- name: Run specs with Sidekiq ${{ matrix.sidekiq_version }}
53-
env:
54-
SIDEKIQ_VERSION: ${{ matrix.sidekiq_version }}
55-
RUBYOPT: ${{ matrix.options.rubyopt }}
56-
run: |
57-
bundle install --jobs 4 --retry 3
58-
make test
65+
- name: Run specs with Sidekiq ${{ matrix.sidekiq_version }}
66+
env:
67+
SIDEKIQ_VERSION: ${{ matrix.sidekiq_version }}
68+
RUBYOPT: ${{ matrix.options.rubyopt }}
69+
run: |
70+
bundle install --jobs 4 --retry 3
71+
make test
5972
60-
- name: Upload Coverage
61-
if: ${{ matrix.options.codecov }}
62-
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
73+
- name: Upload Coverage
74+
if: ${{ matrix.options.codecov }}
75+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d

sentry-opentelemetry/spec/spec_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require "bundler/setup"
44
require "pry"
5-
require "debug" if RUBY_VERSION.to_f >= 2.6
5+
require "debug" if RUBY_VERSION.to_f >= 2.6 && RUBY_ENGINE == "ruby"
66

77
require 'simplecov'
88

0 commit comments

Comments
 (0)