Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI via GitHub actions #78

Merged
merged 8 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI

on: [push, pull_request]

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: [2.5, 2.6, 2.7]
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
AllCops:
TargetRubyVersion: 2.5
Exclude:
- 'spike/*.rb'
NewCops: enable
TargetRubyVersion: 2.5

Gemspec/RequiredRubyVersion:
Enabled: false
Expand Down
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed
- Moved CI to GitHub Actions ([#78])
- Fixed homepage URL in gemspec ([#77])

[Unreleased]: https://github.com/envato/unwrappr/compare/v0.4.0...HEAD
[#77]: https://github.com/envato/unwrappr/pull/77
[#78]: https://github.com/envato/unwrappr/pull/78

## [0.4.0] 2020-04-14
### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ to get regular dependency updates into production.
- Vulnerability advisory information using [bundler-audit](https://github.com/rubysec/bundler-audit)
- Links to the home page, source code and change log (where available) of each gem

## Development status [![Build Status](https://travis-ci.org/envato/unwrappr.svg?branch=master)](https://travis-ci.org/envato/unwrappr)
## Development status [![CI Status](https://github.com/envato/unwrappr/workflows/CI/badge.svg)](https://github.com/envato/unwrappr/actions?query=workflow%3ACI)

`unwrappr` is used in many projects around [Envato][envato]
However, it is still undergoing development and features are likely to change
Expand Down
1 change: 1 addition & 0 deletions lib/unwrappr/gem_change.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def initialize(
end

attr_reader :name, :head_version, :base_version, :line_number

def_delegators :@lock_file_diff, :filename, :sha

def added?
Expand Down
2 changes: 1 addition & 1 deletion lib/unwrappr/git_command_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def git

def log_options
{}.tap do |opt|
opt[:log] = Logger.new(STDOUT) if ENV['DEBUG']
opt[:log] = Logger.new($stdout) if ENV['DEBUG']
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/unwrappr/lock_file_diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def extract_gem_and_change_type(line)
# '+ websocket-driver (0.6.5)'
# Careful not to match this (note the wider indent):
# '+ websocket-extensions (>= 0.1.0)'
pattern = /^(?<change_type>[\+\-]) (?<gem_name>[\S]+) \(\d/
pattern = /^(?<change_type>[+\-]) (?<gem_name>\S+) \(\d/
match = pattern.match(line)
return match[:gem_name], match[:change_type] unless match.nil?
end
Expand Down
8 changes: 3 additions & 5 deletions spec/lib/unwrappr/ruby_gems_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ module Unwrappr
end

context 'runtime error' do
class UnknownError < StandardError; end

before do
allow(Faraday).to receive(:get).and_raise(UnknownError)
allow(Faraday).to receive(:get).and_raise(StandardError)
end

it 'returns nil' do
expect { subject }.to raise_error(instance_of(UnknownError))
it 'is re-raised' do
expect { subject }.to raise_error(instance_of(StandardError))
end
end
end
Expand Down