From 3ffaa4b3356cefbc14752cd37959cd2da743367e Mon Sep 17 00:00:00 2001 From: Matthew Hutchinson Date: Sat, 28 Sep 2024 22:54:25 +0100 Subject: [PATCH] use latest lolcommits, prep new version, add GH actions --- .github/workflows/build.yml | 34 +++++++++++++++++++++++++++ .github/workflows/push_gem.yml | 25 ++++++++++++++++++++ CHANGELOG.md | 7 +++++- README.md | 13 ++++------ Rakefile | 12 +--------- lib/lolcommits/lolsrv/version.rb | 2 +- lolcommits-lolsrv.gemspec | 6 ++--- test/lolcommits/plugin/lolsrv_test.rb | 1 - test/test_helper.rb | 4 ---- 9 files changed, 73 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/push_gem.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..19d0d2f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: Tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby-version: ['3.1', '3.2', '3.3', '3.4'] + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Configure git user name, email + run: | + git config --global user.name $NAME + git config --global user.email $EMAIL + env: + NAME: "George Costanza" + EMAIL: "george.costanza@vandelay.com" + - name: Run tests + run: bundle exec rake test diff --git a/.github/workflows/push_gem.yml b/.github/workflows/push_gem.yml new file mode 100644 index 0000000..d974f13 --- /dev/null +++ b/.github/workflows/push_gem.yml @@ -0,0 +1,25 @@ +name: Publish gem to RubyGems.org + +on: + push: + tags: + - v* + +jobs: + push: + name: Push gem to RubyGems.org + runs-on: ubuntu-latest + + permissions: + id-token: write + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: ruby + + - uses: rubygems/release-gem@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index ca4c7c7..79c314a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ project adheres to [Semantic Versioning][Semver]. - Your contribution here! +## [0.6.0] - 2024-28-09 +### Removed +- Support for Ruby < 3.1 (older rubies no longer supported) + ## [0.5.0] - 2020-01-24 ### Removed - Support for Ruby < 2.4 (older rubies no longer supported) @@ -80,7 +84,8 @@ project adheres to [Semantic Versioning][Semver]. ### Changed - Initial release -[Unreleased]: https://github.com/lolcommits/lolcommits-lolsrv/compare/v0.5.0...HEAD +[Unreleased]: https://github.com/lolcommits/lolcommits-lolsrv/compare/v0.6.0...HEAD +[0.6.0]: https://github.com/lolcommits/lolcommits-lolsrv/compare/v0.5.0...v0.6.0 [0.5.0]: https://github.com/lolcommits/lolcommits-lolsrv/compare/v0.4.0...v0.5.0 [0.4.0]: https://github.com/lolcommits/lolcommits-lolsrv/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/lolcommits/lolcommits-lolsrv/compare/v0.2.0...v0.3.0 diff --git a/README.md b/README.md index a06a9d6..23c9837 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ # Lolcommits Lolsrv +[![Build](https://img.shields.io/github/actions/workflow/status/lolcommits/lolcommits-lolsrv/build.yml?branch=main&style=flat)](https://github.com/lolcommits/lolcommits-lolsrv/actions/workflows/build.yml) [![Gem](https://img.shields.io/gem/v/lolcommits-lolsrv.svg?style=flat)](http://rubygems.org/gems/lolcommits-lolsrv) -[![Travis](https://img.shields.io/travis/com/lolcommits/lolcommits-lolsrv/master.svg?style=flat)](https://travis-ci.com/lolcommits/lolcommits-lolsrv) [![Depfu](https://img.shields.io/depfu/lolcommits/lolcommits-lolsrv.svg?style=flat)](https://depfu.com/github/lolcommits/lolcommits-lolsrv) -[![Maintainability](https://api.codeclimate.com/v1/badges/309c4d765a49dddebbc9/maintainability)](https://codeclimate.com/github/lolcommits/lolcommits-lolsrv/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/309c4d765a49dddebbc9/test_coverage)](https://codeclimate.com/github/lolcommits/lolcommits-lolsrv/test_coverage) [lolcommits](https://lolcommits.github.io/) takes a snapshot with your webcam every time you git commit code, and archives a lolcat style image @@ -36,7 +34,7 @@ The following upload params are `multipart/form-data` encoded: ## Requirements -* Ruby >= 2.4 +* Ruby >= 3.1 * A webcam * [ImageMagick](http://www.imagemagick.org) * [ffmpeg](https://www.ffmpeg.org) (optional) for animated gif capturing @@ -62,8 +60,7 @@ lolcommits will be synced to the remote server. To disable use: ## Development Check out this repo and run `bin/setup`, this will install all -dependencies and generate docs. Run `bundle exec rake` to run all tests -and generate a coverage report. +dependencies and generate docs. Run `bundle exec rake` to run all tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment with the gem code. @@ -114,9 +111,7 @@ The gem is available as open source under the terms of ## Links -* [Travis CI](https://travis-ci.com/lolcommits/lolcommits-lolsrv) -* [Code Climate](https://codeclimate.com/github/lolcommits/lolcommits-lolsrv) -* [Test Coverage](https://codeclimate.com/github/lolcommits/lolcommits-lolsrv/coverage) +* [CI](https://github.com/lolcommits/lolcommits-lolsrv/actions/workflows/build.yml) * [RDoc](http://rdoc.info/projects/lolcommits/lolcommits-lolsrv) * [Issues](http://github.com/lolcommits/lolcommits-lolsrv/issues) * [Report a bug](http://github.com/lolcommits/lolcommits-lolsrv/issues/new) diff --git a/Rakefile b/Rakefile index 5eb2328..c4aa9f2 100644 --- a/Rakefile +++ b/Rakefile @@ -18,14 +18,4 @@ Rake::TestTask.new(:test) do |t| t.test_files = FileList["test/**/*_test.rb"] end -# run tests with code coverage (default) -namespace :test do - desc "Run all tests and features and generate a code coverage report" - task :coverage do - ENV['COVERAGE'] = 'true' - Rake::Task['test'].execute - end -end - - -task :default => ['test:coverage'] +task :default => ['test'] diff --git a/lib/lolcommits/lolsrv/version.rb b/lib/lolcommits/lolsrv/version.rb index 8dc7e56..2015b9e 100644 --- a/lib/lolcommits/lolsrv/version.rb +++ b/lib/lolcommits/lolsrv/version.rb @@ -2,6 +2,6 @@ module Lolcommits module Lolsrv - VERSION = "0.5.0".freeze + VERSION = "0.6.0".freeze end end diff --git a/lolcommits-lolsrv.gemspec b/lolcommits-lolsrv.gemspec index 63001b4..63c2af7 100644 --- a/lolcommits-lolsrv.gemspec +++ b/lolcommits-lolsrv.gemspec @@ -32,15 +32,13 @@ Gem::Specification.new do |spec| spec.executables = [] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.4" + spec.required_ruby_version = ">= 3.1" spec.add_runtime_dependency "rest-client", ">= 2.1.0" - spec.add_runtime_dependency "lolcommits", ">= 0.14.2" + spec.add_runtime_dependency "lolcommits", ">= 0.17.2" spec.add_development_dependency "bundler" spec.add_development_dependency "webmock" - spec.add_development_dependency "pry" spec.add_development_dependency "rake" spec.add_development_dependency "minitest" - spec.add_development_dependency "simplecov" end diff --git a/test/lolcommits/plugin/lolsrv_test.rb b/test/lolcommits/plugin/lolsrv_test.rb index 60601eb..d16c2fc 100644 --- a/test/lolcommits/plugin/lolsrv_test.rb +++ b/test/lolcommits/plugin/lolsrv_test.rb @@ -12,7 +12,6 @@ def runner # a simple lolcommits runner with an empty configuration Hash @runner ||= Lolcommits::Runner.new( - lolcommit_path: Tempfile.new('lolcommit.jpg'), config: TestConfiguration.new(OpenStruct.new) ) end diff --git a/test/test_helper.rb b/test/test_helper.rb index a7a02d9..dd047b7 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -9,10 +9,6 @@ require 'lolcommits/test_helpers/git_repo' require 'lolcommits/test_helpers/fake_io' -if ENV['COVERAGE'] - require 'simplecov' -end - # plugin gem test libs require 'lolcommits/lolsrv' require 'minitest/autorun'