Add github action for rspec

This commit is contained in:
Sven Weidauer 2022-06-05 12:57:27 +02:00
parent 3711acbec3
commit 64d2eb9a43
3 changed files with 39 additions and 0 deletions

34
.github/workflows/rspec.yml vendored Normal file
View file

@ -0,0 +1,34 @@
name: "RSpec"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
rspec:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf
with:
ruby-version: 2.7
- name: Install dependencies
run: bundle install --with=ci
- name: Run tests
run: bundle exec rake spec_github
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: always() # always run even if the previous step fails
with:
report_paths: 'rspec.xml'

View file

@ -6,4 +6,5 @@ gemspec
group :ci do
gem 'code-scanning-rubocop'
gem "rspec_junit_formatter"
end

View file

@ -24,3 +24,7 @@ end
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
RSpec::Core::RakeTask.new(:spec_github) do |t|
t.rspec_opts = '--format RspecJunitFormatter --out rspec.xml'
end