File tree 5 files changed +47
-44
lines changed
5 files changed +47
-44
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 73
73
74
74
- name : Run tests
75
75
run : bundle exec rspec
76
+
77
+ - name : Upload test coverage folder for later reporting
78
+ uses : actions/upload-artifact@v3
79
+ with :
80
+ name : coverage-reports
81
+ path : ${{github.workspace}}/coverage-*/coverage.json
82
+ retention-days : 1
83
+
84
+ coverage :
85
+ name : Report coverage to Code Climate
86
+ runs-on : ubuntu-20.04
87
+ needs : test
88
+ if : success() && github.ref == 'refs/heads/main'
89
+ env :
90
+ CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
91
+ steps :
92
+ - uses : actions/checkout@v3
93
+
94
+ - name : Download coverage reports from the test job
95
+ uses : actions/download-artifact@v3
96
+ with :
97
+ name : coverage-reports
98
+
99
+ -
uses :
paambaati/[email protected]
100
+ with :
101
+ coverageLocations : " coverage-*/coverage.json:simplecov"
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'openssl'
4
+ require 'simplecov_json_formatter'
5
+
6
+ SimpleCov . start do
7
+ command_name "Job #{ File . basename ( ENV [ 'BUNDLE_GEMFILE' ] ) } " if ENV [ 'BUNDLE_GEMFILE' ]
8
+ project_name 'Ruby JWT - Ruby JSON Web Token implementation'
9
+ coverage_dir "coverage-#{ ::OpenSSL ::Digest ::SHA256 . hexdigest ( ENV [ 'GITHUB_STEP_SUMMARY' ] ) } " if ENV [ 'GITHUB_STEP_SUMMARY' ]
10
+ add_filter 'spec'
11
+ end
12
+
13
+ if ENV [ 'CI' ]
14
+ SimpleCov . formatters = SimpleCov ::Formatter ::JSONFormatter
15
+ end
Original file line number Diff line number Diff line change 3
3
require 'bundler/setup'
4
4
require 'bundler/gem_tasks'
5
5
6
- begin
7
- require 'rspec/core/rake_task'
8
- require 'rubocop/rake_task'
6
+ require 'rspec/core/rake_task'
7
+ require 'rubocop/rake_task'
9
8
10
- RSpec ::Core ::RakeTask . new ( :test )
11
- RuboCop ::RakeTask . new ( :rubocop )
9
+ RSpec ::Core ::RakeTask . new ( :test )
10
+ RuboCop ::RakeTask . new ( :rubocop )
12
11
13
- task default : %i[ rubocop test ]
14
- rescue LoadError
15
- puts 'RSpec rake tasks not available. Please run "bundle install" to install missing dependencies.'
16
- end
12
+ task default : %i[ rubocop test ]
Original file line number Diff line number Diff line change 2
2
3
3
require 'rspec'
4
4
require 'simplecov'
5
-
6
- SimpleCov . start do
7
- root File . join ( File . dirname ( __FILE__ ) , '..' )
8
- project_name 'Ruby JWT - Ruby JSON Web Token implementation'
9
- add_filter 'spec'
10
- end
11
-
12
5
require 'jwt'
13
6
14
7
puts "OpenSSL::VERSION: #{ OpenSSL ::VERSION } "
15
8
puts "OpenSSL::OPENSSL_VERSION: #{ OpenSSL ::OPENSSL_VERSION } "
16
9
puts "OpenSSL::OPENSSL_LIBRARY_VERSION: #{ OpenSSL ::OPENSSL_LIBRARY_VERSION } \n \n "
17
10
18
- CERT_PATH = File . join ( File . dirname ( __FILE__ ) , 'fixtures' , 'certs' )
11
+ CERT_PATH = File . join ( __dir__ , 'fixtures' , 'certs' )
19
12
20
13
RSpec . configure do |config |
21
14
config . expect_with :rspec do |c |
You can’t perform that action at this time.
0 commit comments