Skip to content

Commit 3cd1ac5

Browse files
committed
Add a workflow for CI on Github
Travis CI doesn't appear to be configured/working, possibly Github actions would be a good fit for this. - Adds a workflow that runs rspec for ruby 2.6, 2.7 and 3.0. - Updates the build status badge.
1 parent 70ebbf9 commit 3cd1ac5

4 files changed

Lines changed: 40 additions & 56 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7+
8+
name: rspec
9+
10+
on:
11+
push:
12+
branches: ["master"]
13+
pull_request:
14+
branches: ["master"]
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
ruby-version: ["2.6", "2.7", "3.0"]
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Set up Ruby
29+
uses: ruby/setup-ruby@v1
30+
# uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
31+
with:
32+
ruby-version: ${{ matrix.ruby-version }}
33+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34+
- name: Run tests
35+
run: bundle exec rspec

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
capybara-screenshot gem
22
=======================
33

4-
[![Build Status](https://travis-ci.org/mattheworiordan/capybara-screenshot.svg)](https://travis-ci.org/mattheworiordan/capybara-screenshot)
4+
[![Build Status](https://github.com/mattheworiordan/capybara-screenshot/actions/workflows/ci.yml/badge.svg)](https://github.com/mattheworiordan/capybara-screenshot/actions/workflows/ci.yml)
55
[![Code Climate](https://d3s6mut3hikguw.cloudfront.net/github/mattheworiordan/capybara-screenshot.svg)](https://codeclimate.com/github/mattheworiordan/capybara-screenshot)
66
[![Gem Version](https://badge.fury.io/rb/capybara-screenshot.svg)](http://badge.fury.io/rb/capybara-screenshot)
77

@@ -319,7 +319,7 @@ Please raise an issue at [https://github.com/mattheworiordan/capybara-screenshot
319319

320320
#### Contributions
321321

322-
Contributions are welcome. Please fork this gem and then submit a pull request. New features must include test coverage and must pass on all versions of the testing frameworks supported. Run `appraisal` to set up the your Gems. then `appraisal "rake travis:ci"` locally to test your changes against all versions of testing framework gems supported.
322+
Contributions are welcome. Please fork this gem and then submit a pull request. New features must include test coverage and must pass on all versions of the testing frameworks supported. Run `appraisal` to set up the your Gems. then `appraisal "rspec"` locally to test your changes against all versions of testing framework gems supported.
323323

324324
#### Rubygems
325325

Rakefile

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,6 @@
1-
require 'rubygems'
2-
require 'bundler/setup'
1+
require "rubygems"
2+
require "bundler/setup"
33

44
Bundler::GemHelper.install_tasks
55

6-
require 'rspec/core/rake_task'
7-
8-
rspec_rake_task = RSpec::Core::RakeTask.new(:spec)
9-
10-
task default: [:spec]
11-
12-
def target_gem
13-
gem_file = ENV['BUNDLE_GEMFILE'] || ''
14-
targets = %w(cucumber spinach rspec)
15-
16-
target = gem_file.match(/(#{targets.join('|')})/)
17-
if target && targets.include?(target[1])
18-
target[1].to_sym
19-
else
20-
[]
21-
end
22-
end
23-
24-
namespace :travis do
25-
task :ci => target_gem do
26-
Rake::Task['spec'].invoke
27-
end
28-
29-
task :cucumber do
30-
rspec_rake_task.pattern = 'spec/cucumber'
31-
end
32-
33-
task :spinach do
34-
rspec_rake_task.pattern = 'spec/spinach'
35-
end
36-
37-
task :rspec do
38-
rspec_rake_task.pattern = 'spec/rspec'
39-
end
40-
end
6+
require "rspec/core/rake_task"

0 commit comments

Comments
 (0)