Skip to content

Commit

Permalink
Move CI to GitHub Actions #9
Browse files Browse the repository at this point in the history
  • Loading branch information
pkuczynski committed May 26, 2023
2 parents d7cb646 + 738f131 commit 348b4e6
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 49 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: ${{ matrix.ruby }}-${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ruby:
# Due to https://github.com/actions/runner/issues/849, 'x.0' versions have to use quotes
- '2.0'
- 2.1
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
- '3.0'
- 3.1
- jruby
- truffleruby
os:
- macos
- ubuntu
- windows
exclude:
- ruby: 2.2 # Fails on setup: https://github.com/rvm/gem-empty/actions/runs/5094962600/jobs/9159397472
os: ubuntu
- ruby: 2.7 # Fails only on macos: https://github.com/rvm/gem-empty/actions/runs/5094962600/jobs/9159397472
os: macos
- ruby: 3.0 # Fails only on macos: https://github.com/rvm/gem-empty/actions/runs/5094962600/jobs/9159398902
os: macos
- ruby: 3.1 # Fails only on macos: https://github.com/rvm/gem-empty/actions/runs/5094962600/jobs/9159399155
os: macos
- ruby: jruby
os: macos
- ruby: jruby
os: windows
- ruby: truffleruby
os: macos
- ruby: truffleruby
os: windows

runs-on: ${{ matrix.os }}-latest

steps:
- uses: actions/checkout@v3

- name: Setup ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- run: bundle install

- run: bundle exec rake test
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

6 changes: 0 additions & 6 deletions Changelog.md

This file was deleted.

13 changes: 3 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
source "https://rubygems.org"

#ruby=2.0.0

gemspec

group :development do
# statistics only on MRI 2.0 - avoid problems on older rubies
gem "redcarpet", :platforms => [:mri_20]
gem "simplecov", :platforms => [:mri_20]
gem "coveralls", :platforms => [:mri_20]

# rubinius support
gem "rubysl-mutex_m", :platforms => [:rbx]
gem "rubysl-singleton", :platforms => [:rbx]
gem "simplecov", :platforms => :ruby
gem "coveralls", :platforms => :ruby
gem "os"
end
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Gem empty

[![Gem Version](https://badge.fury.io/rb/gem-empty.png)](http://rubygems.org/gems/gem-empty)
[![Version](https://img.shields.io/gem/v/gem-empty)](https://rubygems.org/gems/gem-empty)
[![Downloads Total](https://img.shields.io/gem/dt/gem-empty)](https://rubygems.org/gems/gem-empty)
[![Tests](https://github.com/rvm/gem-empty/workflows/tests/badge.svg)](https://github.com/rvm/gem-empty/actions?query=branch%3Amaster)
[![Code Climate](https://codeclimate.com/github/rvm/gem-empty.png)](https://codeclimate.com/github/rvm/gem-empty)
[![Coverage Status](https://coveralls.io/repos/rvm/gem-empty/badge.png?branch=master)](https://coveralls.io/r/rvm/gem-empty?branch=master)
[![Build Status](https://travis-ci.org/rvm/gem-empty.png?branch=master)](https://travis-ci.org/rvm/gem-empty)
[![Dependency Status](https://gemnasium.com/rvm/gem-empty.png)](https://gemnasium.com/rvm/gem-empty)
[![Documentation](http://b.repl.ca/v1/yard-docs-blue.png)](http://rubydoc.info/gems/gem-empty/frames)
[![Coverage](https://coveralls.io/repos/rvm/gem-empty/badge.png?branch=master)](https://coveralls.io/r/rvm/gem-empty?branch=master)
[![Financial Contributors on Open Collective](https://opencollective.com/rvm/all/badge.svg?label=backers)](https://opencollective.com/rvm)

Gem command to remove all gems from current `GEM_HOME`

Expand Down
4 changes: 1 addition & 3 deletions lib/gem-empty/specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ module GemEmpty
# monkey patch rubygems specification to easily find gem version
module Specification
def self.installed_gems
if
Gem::VERSION > '1.8'
then
if Gem::VERSION > '1.8'
Gem::Specification.to_a
else
Gem.source_index.map{|name,spec| spec}
Expand Down
3 changes: 2 additions & 1 deletion test/gem-empty/command_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def self.remove_spec spec
file.unlink
@ui = Gem::MockGemUi.new
@found_minitest = Gem::Specification.find_by_name('minitest')
installer = Gem::Installer.new(@found_minitest.cache_file, :version => @found_minitest.version, :install_dir => @test_path)
package = RUBY_VERSION >= "2.3" ? Gem::Package.new(@found_minitest.cache_file) : @found_minitest.cache_file
installer = Gem::Installer.new(package, :version => @found_minitest.version, :install_dir => @test_path)
bundler_git_gems_path = File.join(@test_path,'bundler','gems')
FileUtils.mkdir_p(bundler_git_gems_path)
@git_gem_file = File.join(bundler_git_gems_path, 'git-test')
Expand Down
7 changes: 4 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
if
RUBY_VERSION == "2.0.0" # check Gemfile
then
require "os"

# Coverage only on newer ruby to avoid problems with older versions
if RUBY_VERSION == "3.0.0" && !OS.windows? && !OS.mac?
require "coveralls"
require "simplecov"

Expand Down

0 comments on commit 348b4e6

Please sign in to comment.