Skip to content

Commit c0ebecf

Browse files
ci: Add appraisals for OTLP exporter (#1499)
* ci: Add appraisals for OTLP exporter This is an attempt to ensure compatability with a range of google-protobuf gem versions * squash: Bring in @robbkidd changes --------- Co-authored-by: Robert <[email protected]>
1 parent 8e4da19 commit c0ebecf

File tree

4 files changed

+40
-37
lines changed

4 files changed

+40
-37
lines changed

.github/actions/test_gem/action.yml

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ runs:
3232
id: setup
3333
shell: bash
3434
run: |
35+
# 🛠️ Setup 🛠️
3536
dir=$(find . -iname '${{ inputs.gem }}.gemspec' -exec dirname {} \;)
3637
echo "gem_dir=${dir}" >> $GITHUB_OUTPUT
3738
@@ -57,76 +58,68 @@ runs:
5758
# ...but not for appraisals, sadly.
5859
- name: Install Ruby ${{ inputs.ruby }} with dependencies
5960
if: "${{ steps.setup.outputs.appraisals == 'false' }}"
60-
uses: ruby/setup-ruby@v1
61+
uses: ruby/setup-ruby@v1.144.1
6162
with:
6263
ruby-version: "${{ inputs.ruby }}"
6364
working-directory: "${{ steps.setup.outputs.gem_dir }}"
65+
bundler: "latest"
6466
bundler-cache: true
6567
cache-version: "v1-${{ steps.setup.outputs.cache_key }}"
6668

6769
# If we're using appraisals, do it all manually.
6870
- name: Install Ruby ${{ inputs.ruby }} without dependencies
6971
if: "${{ steps.setup.outputs.appraisals == 'true' }}"
70-
uses: ruby/setup-ruby@v1
72+
uses: ruby/setup-ruby@v1.144.1
7173
with:
7274
ruby-version: "${{ inputs.ruby }}"
73-
- name: Install dependencies and appraisals
75+
bundler: "latest"
76+
working-directory: "${{ steps.setup.outputs.gem_dir }}"
77+
- name: Install dependencies and generate appraisals
7478
if: "${{ steps.setup.outputs.appraisals == 'true' }}"
7579
shell: bash
7680
run: |
77-
cd "${{ steps.setup.outputs.gem_dir }}"
78-
bundle install
79-
bundle exec appraisal install
81+
# 💎 Install dependencies and generate appraisals 💎
82+
bundle install --quiet --jobs=3 --retry=4
83+
bundle exec appraisal generate
84+
working-directory: "${{ steps.setup.outputs.gem_dir }}"
8085

8186
- name: Test Gem
8287
shell: bash
8388
run: |
84-
cd "${{ steps.setup.outputs.gem_dir }}"
85-
89+
# 🍿 Test Gem 🍿
8690
if [[ -f "Appraisals" ]]; then
87-
bundle exec appraisal rake test
91+
for i in `bundle exec appraisal list | sed 's/-/_/g' `; do
92+
echo "::group::🔎 Appraising ${i}"
93+
BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle install --quiet --jobs=3 --retry=4 && \
94+
BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle show && \
95+
BUNDLE_GEMFILE=gemfiles/${i}.gemfile bundle exec rake test
96+
echo "::endgroup::"
97+
done
8898
else
8999
bundle exec rake test
90100
fi
91-
env:
92-
TEST_KAFKA_HOST: "127.0.0.1"
93-
TEST_KAFKA_PORT: 29092
94-
TEST_MYSQL_HOST: "127.0.0.1"
95-
TEST_MYSQL_PORT: 3306
96-
TEST_MYSQL_USER: mysql
97-
TEST_MYSQL_PASSWORD: mysql
98-
TEST_POSTGRES_PASSWORD: postgres
99-
TEST_POSTGRES_USER: postgres
100-
TEST_POSTGRES_HOST: localhost
101-
TEST_POSTGRES_PORT: 5432
102-
TEST_POSTGRES_DB: postgres
103-
TEST_MEMCACHED_HOST: localhost
104-
TEST_MEMCACHED_PORT: 11211
105-
TEST_MONGODB_HOST: localhost
106-
TEST_MONGODB_PORT: 27017
107-
TEST_RABBITMQ_HOST: localhost
108-
TEST_RABBITMQ_PORT: 5672
109-
TEST_RABBITMQ_URL: amqp://guest:guest@localhost:5672
110-
TEST_REDIS_HOST: localhost
111-
TEST_REDIS_PORT: 6379
101+
working-directory: "${{ steps.setup.outputs.gem_dir }}"
112102

113103
- name: YARD
114104
shell: bash
115105
if: "${{ inputs.yard == 'true' }}"
116106
run: |
117-
cd "${{ steps.setup.outputs.gem_dir }}"
107+
# 📄 Yard Docs 📄
118108
bundle exec rake yard
109+
working-directory: "${{ steps.setup.outputs.gem_dir }}"
119110

120111
- name: Rubocop
121112
shell: bash
122113
if: "${{ inputs.rubocop == 'true' }}"
123114
run: |
124-
cd "${{ steps.setup.outputs.gem_dir }}"
115+
# 🤖 Rubocop 🤖
125116
bundle exec rake rubocop
117+
working-directory: "${{ steps.setup.outputs.gem_dir }}"
126118

127119
- name: Build Gem
128120
shell: bash
129121
if: "${{ inputs.build == 'true' }}"
130122
run: |
131-
cd "${{ steps.setup.outputs.gem_dir }}"
123+
# 📦 Build Gem 📦
132124
gem build ${{ inputs.gem }}.gemspec
125+
working-directory: "${{ steps.setup.outputs.gem_dir }}"

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111

1212

1313
# Appraisals
14-
instrumentation/**/gemfiles
15-
16-
# Sqlite file for tests
17-
instrumentation/active_record/db
14+
**/*/gemfiles
1815

1916
# Vendored gems
2017
**/vendor/**/*

exporter/otlp/Appraisals

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# frozen_string_literal: true
2+
3+
# Copyright The OpenTelemetry Authors
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
(19..23).each do |i|
8+
version = "3.#{i}"
9+
appraise "google-protobuf-#{version}" do
10+
gem 'google-protobuf', "~> #{version}"
11+
end
12+
end

exporter/otlp/opentelemetry-exporter-otlp.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
3232
spec.add_dependency 'opentelemetry-sdk', '~> 1.2'
3333
spec.add_dependency 'opentelemetry-semantic_conventions'
3434

35+
spec.add_development_dependency 'appraisal', '~> 2.2.0'
3536
spec.add_development_dependency 'bundler', '>= 1.17'
3637
spec.add_development_dependency 'faraday', '~> 0.13'
3738
spec.add_development_dependency 'minitest', '~> 5.0'

0 commit comments

Comments
 (0)