Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,29 @@ jobs:
- name: Run RSpec tests
run: bundle exec rspec

latest-rails:
name: RSpec (latest Rails / stable Ruby)
runs-on: ubuntu-latest
env:
BUNDLE_GEMFILE: gemfiles/otel.gemfile
RAILS_VERSION: '>= 5.2'
RAILS_ENV: test
GH_ACTIONS_UNIT_TESTS: 1
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Use stable Ruby
uses: ruby/setup-ruby@14594264cd68ce8a2345dd349bc3d138a4ef85c8 # v1.327.0
with:
ruby-version: ruby
bundler: 4.0.13
- name: Resolve latest Rails and dependencies
run: bundle update --all
- name: Report resolved versions and require logs dependencies
run: |
bundle exec ruby -rrails -rjson -ropentelemetry-sdk -ropentelemetry-logs-sdk -ropentelemetry/exporter/otlp_logs -e 'puts "Ruby #{RUBY_VERSION}, Rails #{Rails.version}, JSON #{JSON::VERSION}"'
- name: Run RSpec tests
run: bundle exec rspec

logs-integration:
name: Logs integration (Ruby ${{ matrix.ruby-version }})
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ BUNDLE_GEMFILE=gemfiles/otel.gemfile bundle exec rspec

Without that bundle, those two integration tests are reported as pending. CI runs both bundles.

CI also runs the full suite with real OpenTelemetry dependencies on stable Ruby and the latest stable Rails eligible under the repository's 7-day RubyGems cooldown. This job sets `RAILS_VERSION='>= 5.2'` and runs `bundle update --all` so the committed lockfile does not keep Rails on an older version. The existing Ruby matrix continues to use the committed lockfiles.

The public API snapshot covers both `posthog-ruby` and `posthog-rails`. If you intentionally change either API, update the snapshot and review the diff:

```bash
Expand Down
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ gemspec
gem 'concurrent-ruby', require: 'concurrent'
gem 'irb'

rails_version = ENV.fetch('RAILS_VERSION', '~> 7.1')

group :development, :test do
gem 'activesupport', '~> 7.1'
gem 'activesupport', rails_version
gem 'commander', '~> 5.0'
gem 'mcp', '>= 1.4'
gem 'oj', '~> 3.17.7'
gem 'prettier'
gem 'railties', '~> 7.1'
gem 'railties', rails_version
gem 'rake', '~> 13.4.2'
gem 'rspec', '~> 3.13'
gem 'rubocop', '~> 1.91.0'
Expand Down
Loading