Skip to content

Commit 7cc1153

Browse files
authored
chore: use coveralls (#10)
1 parent 4c43d79 commit 7cc1153

21 files changed

+465
-339
lines changed
Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
name: CI
1+
name: CI linux
22
on:
33
push:
4-
branches:
5-
- master
64
pull_request:
75

86
jobs:
@@ -16,6 +14,7 @@ jobs:
1614
- { ruby_version: 2.7 }
1715
- { ruby_version: 3.0 }
1816
- { ruby_version: 3.1 }
17+
- { ruby_version: 3.2 }
1918
- { ruby_version: jruby }
2019
steps:
2120
- uses: actions/checkout@v1
@@ -31,22 +30,9 @@ jobs:
3130
bundle install --jobs 4 --retry 3 --no-cache
3231
bundle exec rspec
3332
34-
- uses: coverallsapp/github-action@master
33+
- uses: coverallsapp/github-action@v2
34+
env:
35+
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
3536
with:
36-
github-token: ${{ secrets.GITHUB_TOKEN }}
37-
flag-name: ruby-${{ matrix.ruby_version }}
38-
path-to-lcov: ./coverage/lcov/sentry-sanitizer.lcov
37+
flag-name: ruby-${{ join(matrix.*, '-') }}
3938
parallel: true
40-
41-
coverage:
42-
needs: rspec
43-
name: Unit tests
44-
if: ${{ always() }}
45-
runs-on: ubuntu-latest
46-
steps:
47-
- uses: coverallsapp/github-action@master
48-
with:
49-
github-token: ${{ secrets.GITHUB_TOKEN }}
50-
carryforward: "ruby-2.5,ruby-2.7,ruby-3.0,ruby-3.1,ruby-jruby"
51-
parallel-finished: true
52-

.github/workflows/ci-macos.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI macos
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
rspec:
8+
name: Unit tests
9+
runs-on: macos-latest
10+
strategy:
11+
matrix:
12+
include:
13+
- { ruby_version: 2.5 }
14+
- { ruby_version: 2.7 }
15+
- { ruby_version: 3.0 }
16+
- { ruby_version: 3.1 }
17+
- { ruby_version: 3.2 }
18+
- { ruby_version: jruby }
19+
steps:
20+
- uses: actions/checkout@v1
21+
22+
- name: Set up Ruby ${{ matrix.ruby_version }}
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
bundler: 2
26+
ruby-version: ${{ matrix.ruby_version }}
27+
28+
- name: Run specs
29+
run: |
30+
bundle install --jobs 4 --retry 3 --no-cache
31+
bundle exec rspec
32+
33+
- uses: coverallsapp/github-action@v2
34+
env:
35+
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
36+
with:
37+
flag-name: ruby-${{ join(matrix.*, '-') }}
38+
parallel: true
39+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Coveralls
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
coveralls:
8+
name: Coveralls Report
9+
runs-on: ubuntu-latest
10+
if: ${{ always() }}
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Wait on tests (PR)
15+
uses: lewagon/[email protected]
16+
if: github.event_name == 'pull_request'
17+
with:
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
repo-token: ${{ secrets.GITHUB_TOKEN }}
20+
wait-interval: 10 # seconds
21+
running-workflow-name: Coveralls Report
22+
allowed-conclusions: success,skipped,cancelled,failure
23+
24+
- name: Wait on tests
25+
uses: lewagon/[email protected]
26+
with:
27+
ref: ${{ github.sha }}
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
wait-interval: 10 # seconds
30+
running-workflow-name: Coveralls Report
31+
allowed-conclusions: success,skipped,cancelled,failure
32+
33+
- uses: coverallsapp/github-action@v2
34+
env:
35+
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
36+
with:
37+
carryforward: "ruby-2.5,ruby-2.6,ruby-2.7,ruby-3.0,ruby-3.1,ruby-jruby"
38+
parallel-finished: true

.rubocop.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
AllCops:
2+
NewCops: enable
3+
SuggestExtensions: false
4+
5+
Style/StringLiterals:
6+
EnforcedStyle: double_quotes
7+
8+
Metrics/BlockLength:
9+
Enabled: false
10+
11+
Style/Documentation:
12+
Enabled: false
13+
14+
Layout/LineLength:
15+
Enabled: false
16+
17+
Naming/FileName:
18+
Enabled: false
19+
20+
Metrics/MethodLength:
21+
Enabled: false
22+
23+
Metrics/ClassLength:
24+
Enabled: false
25+
26+
Metrics/AbcSize:
27+
Enabled: false
28+
29+
Gemspec/RequiredRubyVersion:
30+
Enabled: false
31+
32+
Style/SelectByRegexp:
33+
Enabled: false
34+
35+
Style/CaseLikeIf:
36+
Enabled: false

Gemfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
# frozen_string_literal: true
2+
13
source "https://rubygems.org"
24

3-
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
5+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
46

57
# Specify your gem's dependencies in sentry-sanitizer.gemspec
68
gemspec
79

8-
gem 'simplecov', require: false, group: :test
9-
gem 'simplecov-lcov', require: false, group: :test
10+
gem "rubocop", "~> 1.28.2"
11+
gem "simplecov", require: false, group: :test
12+
13+
gem "bundler", ">= 1.17"
14+
gem "rack"
15+
gem "rake", "~> 10.0"
16+
gem "rspec", "~> 3.0"

Gemfile.lock

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@ PATH
77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
codecov (0.6.0)
11-
simplecov (>= 0.15, < 0.22)
10+
ast (2.4.2)
1211
concurrent-ruby (1.1.10)
1312
diff-lcs (1.5.0)
1413
docile (1.4.0)
14+
parallel (1.23.0)
15+
parser (3.2.2.1)
16+
ast (~> 2.4.1)
1517
rack (2.2.3.1)
18+
rainbow (3.1.1)
1619
rake (10.5.0)
20+
regexp_parser (2.8.0)
21+
rexml (3.2.5)
1722
rspec (3.11.0)
1823
rspec-core (~> 3.11.0)
1924
rspec-expectations (~> 3.11.0)
@@ -27,26 +32,37 @@ GEM
2732
diff-lcs (>= 1.2.0, < 2.0)
2833
rspec-support (~> 3.11.0)
2934
rspec-support (3.11.0)
35+
rubocop (1.28.2)
36+
parallel (~> 1.10)
37+
parser (>= 3.1.0.0)
38+
rainbow (>= 2.2.2, < 4.0)
39+
regexp_parser (>= 1.8, < 3.0)
40+
rexml
41+
rubocop-ast (>= 1.17.0, < 2.0)
42+
ruby-progressbar (~> 1.7)
43+
unicode-display_width (>= 1.4.0, < 3.0)
44+
rubocop-ast (1.29.0)
45+
parser (>= 3.2.1.0)
46+
ruby-progressbar (1.13.0)
3047
sentry-ruby (5.4.1)
3148
concurrent-ruby (~> 1.0, >= 1.0.2)
3249
simplecov (0.18.5)
3350
docile (~> 1.1)
3451
simplecov-html (~> 0.11)
3552
simplecov-html (0.12.3)
36-
simplecov-lcov (0.8.0)
53+
unicode-display_width (2.4.2)
3754

3855
PLATFORMS
3956
ruby
4057

4158
DEPENDENCIES
4259
bundler (>= 1.17)
43-
codecov
4460
rack
4561
rake (~> 10.0)
4662
rspec (~> 3.0)
63+
rubocop (~> 1.28.2)
4764
sentry-sanitizer!
4865
simplecov
49-
simplecov-lcov
5066

5167
BUNDLED WITH
5268
2.3.16

Rakefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# frozen_string_literal: true
2+
13
require "bundler/gem_tasks"
24
require "rspec/core/rake_task"
35

46
RSpec::Core::RakeTask.new(:spec)
57

6-
task :default => :spec
8+
task default: :spec

bin/console

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

34
require "bundler/setup"
45
require "sentry/sanitizer"

lefthook.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pre-commit:
2+
commands:
3+
lint:
4+
run: bundle exec rubocop -A {staged_files}
5+
glob: "*.rb"
6+
stage_fixed: true

lib/sentry-sanitizer.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
require 'sentry/sanitizer/version'
2-
require 'sentry/sanitizer'
1+
# frozen_string_literal: true
2+
3+
require "sentry/sanitizer/version"
4+
require "sentry/sanitizer"

0 commit comments

Comments
 (0)