Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github workflow check.yml #25

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions .github/workflows/.rspec_parallel
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--format RspecJunitFormatter
--out junit/<%= ENV['TEST_ENV_NUMBER'] %>_<%= ENV['TEST_TYPE'] %>_<%= ENV['PROTOCOL'] %>_ruby-<%= ENV['RUBY_VERSION'] %>.junit
47 changes: 47 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
pull_request:
push:
branches:
- main

jobs:
check:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
ruby: [ '2.7', '3.0', '3.1' ]
protocol: [ 'json', 'msgpack' ]
type: [ 'unit', 'acceptance' ]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: 'Run ${{ matrix.type }} tests on ruby ${{ matrix.ruby }} (${{ matrix.protocol }} protocol)'
env:
PARALLEL_TEST_PROCESSORS: 2
RSPEC_RETRY: true
PROTOCOL: ${{ matrix.protocol }}
TEST_TYPE: ${{ matrix.type }}
RUBY_VERSION: ${{ matrix.ruby }}
run: |
cp .github/workflows/.rspec_parallel .rspec_parallel
mkdir junit
bundle exec parallel_rspec --prefix-output-with-test-env-number --first-is-1 -- spec/${{ matrix.type }}
- uses: actions/upload-artifact@v3
with:
path: |
junit/
coverage/
retention-days: 7
- name: Upload test results
if: always()
uses: ably-labs/test-observability-action@main
with:
server-url: 'https://test-observability.herokuapp.com'
server-auth: ${{ secrets.TEST_OBSERVABILITY_SERVER_AUTH_KEY }}
path: 'junit/'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Gemfile.lock
.yardoc
doc/*
pkg
coverage/
junit/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Ably](https://www.ably.io)
# [Ably](https://ably.com)

[![Gem Version](https://img.shields.io/gem/v/ably?style=flat)](https://img.shields.io/gem/v/ably?style=flat)

[![Gem Version](https://badge.fury.io/rb/ably-rest.svg)](http://badge.fury.io/rb/ably-rest)
[![Coverage Status](https://coveralls.io/repos/ably/ably-ruby-rest/badge.svg)](https://coveralls.io/r/ably/ably-ruby-rest)

_[Ably](https://ably.com) is the platform that powers synchronized digital experiences in realtime. Whether attending an event in a virtual venue, receiving realtime financial information, or monitoring live car performance data – consumers simply expect realtime digital experiences as standard. Ably provides a suite of APIs to build, extend, and deliver powerful digital experiences in realtime for more than 250 million devices across 80 countries each month. Organizations like Bloomberg, HubSpot, Verizon, and Hopin depend on Ably’s platform to offload the growing complexity of business-critical realtime data synchronization at global scale. For more information, see the [Ably documentation](https://ably.com/documentation)._

Expand Down
7 changes: 6 additions & 1 deletion ably-rest.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'yard', '~> 0.9'

spec.add_development_dependency 'webmock', '~> 3.14.0'
spec.add_development_dependency 'coveralls'
spec.add_development_dependency 'pry', '~> 0.14.1'
spec.add_development_dependency 'pry-byebug'

spec.add_development_dependency 'rspec_junit_formatter', '~> 0.5.1'
spec.add_development_dependency 'rspec-instafail', '~> 1.0'
spec.add_development_dependency 'simplecov', '~> 0.21.2'
spec.add_development_dependency 'simplecov-lcov', '~> 0.8.0'
spec.add_development_dependency 'parallel_tests', '~> 3.8'

if RUBY_VERSION.match(/^3\./)
spec.add_development_dependency 'webrick', '~> 1.7.0'
end
Expand Down
14 changes: 14 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ def console(message)
puts "\033[31m[#{Time.now.strftime('%H:%M:%S.%L')}]\033[0m \033[33m#{message}\033[0m"
end

unless RUBY_VERSION.match(/^1\./)
require 'simplecov'

SimpleCov.start do
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = 'coverage/lcov.info'
end
formatter SimpleCov::Formatter::LcovFormatter
add_filter %w[vendor spec]
end
end

require 'webmock/rspec'

require 'ably-rest'
Expand Down