Skip to content
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
82 changes: 82 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
name: CI
on:
push:
tags: ['v*']
branches: [master]
pull_request:
branches: ['**']
jobs:
# Tests are currently failing because they rely on a live YouTube account
# Until that issue is resolved, the tests are not very useful. Disabling them
# in CI for now.
# test:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# ruby:
# - '2.1'
# - '2.3'
# - '2.4'
# - '2.5'
# - '2.6'
# - '2.7'
# - '3.0'
# - '3.1'
# - '3.2'
# - '3.3'
# - jruby-head
# - truffleruby-head
#
# steps:
# - uses: actions/checkout@v4
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: ${{ matrix.ruby }}
# bundler-cache: true
# - run: bundle exec rspec --format doc
# - uses: codecov/codecov-action@v3
# if: matrix.ruby == '3.2'
# with:
# files: coverage/coverage.xml

yard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- run: bundle exec yardoc --fail-on-warning

check_version:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- run: bin/check-version

release:
# Disabling tests for now
# needs: [test, yard, check_version]
needs: [yard, check_version]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
3 changes: 1 addition & 2 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
--color
--exclude_pattern spec/requests/as_content_owner/*_spec.rb
--tag=~slow
--exclude-pattern spec/requests/as_content_owner/*_spec.rb
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

12 changes: 11 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in yt.gemspec
gemspec
gemspec

not_jruby = %i[ruby mingw x64_mingw].freeze

# We add non-essential gems like debugging tools and CI dependencies
# here. This also allows us to use conditional dependencies that depend on the
# platform
gem 'pry', platforms: not_jruby
gem 'simplecov'
gem 'simplecov-cobertura'
gem 'yard'
4 changes: 2 additions & 2 deletions MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014–present Fullscreen, Inc.
Copyright (c) 2014–present Nullscreen

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 changes: 0 additions & 11 deletions Rakefile

This file was deleted.

14 changes: 14 additions & 0 deletions bin/check-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh

set -e

tag="$(git describe --abbrev=0 2>/dev/null || echo)"
echo "Tag: ${tag}"
tag="${tag#v}"
echo "Git Version: ${tag}"
[ "$tag" = '' ] && exit 0
gem_version="$(ruby -r ./lib/yt/version -e "puts Yt::VERSION" | tail -n1)"
echo "Gem Version: ${gem_version}"

tag_gt_version="$(ruby -r ./lib/yt/version -e "puts Gem::Version.new(Yt::VERSION) >= Gem::Version.new('${tag}')" | tail -n1)"
test "$tag_gt_version" = true
4 changes: 0 additions & 4 deletions gemfiles/Gemfile.activesupport-3.x

This file was deleted.

4 changes: 0 additions & 4 deletions gemfiles/Gemfile.activesupport-4.x

This file was deleted.

14 changes: 12 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
require 'simplecov'

SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
SimpleCov.start
if ENV['CI']
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
else
require 'simplecov-cobertura'
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end

SimpleCov.start do
enable_coverage :branch
add_filter '/spec/'
add_filter '/vendor/'
end

ENV['YT_TEST_CLIENT_ID'] ||= 'XXX'
ENV['YT_TEST_CLIENT_SECRET'] ||= 'YYY'
Expand Down
17 changes: 5 additions & 12 deletions yt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,25 @@ require 'yt/version'
Gem::Specification.new do |spec|
spec.name = "yt"
spec.version = Yt::VERSION
spec.authors = ["Claudio Baccigalupo"]
spec.email = ["claudio@fullscreen.net"]
spec.authors = ["Nullscreen"]
spec.email = ["nullscreen.code@gmail.com"]
spec.description = %q{Youtube V3 API client.}
spec.summary = %q{Yt makes it easy to interact with Youtube V3 API by
providing a modular, intuitive and tested Ruby-style API.}
spec.homepage = "http://github.com/Fullscreen/yt"
spec.homepage = "http://github.com/nullscreen/yt"
spec.license = "MIT"

spec.required_ruby_version = '>= 2.1'

spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
end

spec.files = Dir['lib/**/*.rb', '*.md', '*.txt', '.yardopts', 'MIT-LICENSE']
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency 'activesupport'

# For development / Code coverage / Documentation
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rake'
# spec.add_development_dependency 'yard'
# spec.add_development_dependency 'coveralls'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'vcr'
spec.add_development_dependency 'webmock'
end
Loading