Skip to content
Merged
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
17 changes: 13 additions & 4 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ name: Ruby

on:
push:
branches:
- '**' # run on all branches
tags-ignore:
- '**' # skip all tags
pull_request_target:
types: [opened, reopened]
types: [opened, reopened, synchronize]

jobs:
test:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby-version: ['3.1']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
Expand All @@ -30,8 +33,14 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: set up config file
run: cp config/config.test.rb config/config.rb
run: cp config/config.test.rb config/config.rb
- name: Run tests
env:
UT_APIKEY: ${{ secrets.UT_APIKEY }}
run: bundle exec rake test TESTOPTS="-v"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.ruby-version }}
verbose: true
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
*.gem
.DS_Store
config/config.rb
/config/config.rb

# Specific to IntelliJ
.idea/

# Specific to rbenv
.ruby-version
.ruby-version

# Codecov local cache
/coverage/
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ gemspec
gem 'pry'
gem 'rake'
gem 'rubocop', '~> 1.43'
gem "simplecov", require: false
gem "simplecov-cobertura", require: false
19 changes: 16 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.3.5)
connection_pool (2.5.4)
docile (1.4.1)
drb (2.2.3)
excon (1.3.1)
logger
Expand All @@ -50,11 +51,11 @@ GEM
faraday (>= 1, < 3)
faraday-multipart (1.1.1)
multipart-post (~> 2.0)
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
faraday-net_http (3.4.2)
net-http (~> 0.5)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.15.2)
json (2.16.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
Expand Down Expand Up @@ -84,6 +85,7 @@ GEM
rainbow (3.1.1)
rake (13.3.1)
regexp_parser (2.11.3)
rexml (3.4.4)
rubocop (1.81.7)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
Expand All @@ -100,6 +102,15 @@ GEM
prism (~> 1.4)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (3.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
Expand All @@ -119,6 +130,8 @@ DEPENDENCIES
pry
rake
rubocop (~> 1.43)
simplecov
simplecov-cobertura

BUNDLED WITH
2.6.9
16 changes: 16 additions & 0 deletions test/test_case.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
# frozen_string_literal: true
# Start simplecov if this is a coverage task or if it is run in the CI pipeline
if ENV['COVERAGE'] || ENV['CI']
require 'simplecov'
require 'simplecov-cobertura'

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::CoberturaFormatter, # writes coverage/cobertura.xml
])

SimpleCov.start do
enable_coverage :branch
add_filter %w[/test/ /config/]
end
end

require 'bundler/setup'
require 'pry'
require 'minitest/autorun'
Expand Down