Skip to content

Commit

Permalink
Merge pull request #66 from ms-ati/add-github-actions-ci
Browse files Browse the repository at this point in the history
Add Github Actions CI configuration
  • Loading branch information
ms-ati committed May 6, 2021
2 parents bcc9d78 + 5455d69 commit 46d4f3f
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Main
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: 'CI Tests'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
ruby: [jruby, truffleruby, 2.5, 2.6, 2.7, '3.0', head]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: false
- run: bundle install
- run: bundle exec rspec
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

# Travis-only dependencies go here
if ENV["CI"] == "true"
if ENV["CI"] == "true" && RUBY_ENGINE == "ruby"
gem "codecov", require: false, group: "test"
end

Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/ms-ati/docile)
[![Docs Coverage](http://inch-ci.org/github/ms-ati/docile.png)](http://inch-ci.org/github/ms-ati/docile)

[![Build Status](https://github.com/ms-ati/docile/actions/workflows/main.yml/badge.svg)](https://github.com/ms-ati/docile/actions/workflows/main.yml)
[![Build Status](https://img.shields.io/travis/ms-ati/docile/master.svg)](https://travis-ci.org/ms-ati/docile)
[![Code Coverage](https://img.shields.io/codecov/c/github/ms-ati/docile.svg)](https://codecov.io/github/ms-ati/docile)
[![Maintainability](https://api.codeclimate.com/v1/badges/79ca631bc123f7b83b34/maintainability)](https://codeclimate.com/github/ms-ati/docile/maintainability)
Expand Down Expand Up @@ -351,13 +352,20 @@ $ gem install docile

## Status

Works on [all currently supported ruby versions](https://github.com/ms-ati/docile/blob/master/.travis.yml), or so Travis CI [tells us](https://travis-ci.org/ms-ati/docile).
Works on [all currently supported ruby versions](https://github.com/ms-ati/docile/blob/master/.github/workflows/main.yml),
or so [Github Actions](https://github.com/ms-ati/docile/actions)
and [Travis CI](https://travis-ci.org/ms-ati/docile)
tell us.

Used by some pretty cool gems to implement their DSLs, notably including [SimpleCov](https://github.com/colszowka/simplecov). Keep an eye out for new gems using Docile at the [Ruby Toolbox](https://www.ruby-toolbox.com/projects/docile).
Used by some pretty cool gems to implement their DSLs, notably including
[SimpleCov](https://github.com/colszowka/simplecov). Keep an eye out for new
gems using Docile at the
[Ruby Toolbox](https://www.ruby-toolbox.com/projects/docile).

## Release Policy

Docile releases follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).
Docile releases follow
[Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).

## Note on Patches/Pull Requests

Expand All @@ -376,4 +384,5 @@ Docile releases follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.

Copyright (c) 2012-2021 Marc Siegel.

Licensed under the [MIT License](http://choosealicense.com/licenses/mit/), see [LICENSE](LICENSE) for details.
Licensed under the [MIT License](http://choosealicense.com/licenses/mit/),
see [LICENSE](LICENSE) for details.
4 changes: 2 additions & 2 deletions docile.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Gem::Specification.new do |s|
end
s.require_paths = ["lib"]

# Specify oldest supported Ruby version
s.required_ruby_version = ">= 2.6.0"
# Specify oldest supported Ruby version (2.5 to support JRuby 9.2.17.0)
s.required_ruby_version = ">= 2.5.0"

s.add_development_dependency "rake", "~> 12.3.3"
s.add_development_dependency "rspec", "~> 3.9"
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
add_filter "/vendor/" # exclude gems which are vendored on Travis CI
end

# On CI we publish simplecov results to codecov.io
if ENV["CI"] == "true"
# On CI we publish coverage to codecov.io, except on JRuby and TruffleRuby
if ENV["CI"] == "true" && RUBY_ENGINE == "ruby"
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end
Expand Down

0 comments on commit 46d4f3f

Please sign in to comment.