Skip to content

Commit

Permalink
Circleci project setup (#2)
Browse files Browse the repository at this point in the history
* Add .circleci/config.yml

* remove travisci config

* update dependencies

* update badges

* create basic ruby gem publish

* use newer ruby version

* commit gemfile lock

* add codeclimate test coverage

* add codeclimate test coverage

* json fix for codeclimate test reporter

see codeclimate/test-reporter#495
  • Loading branch information
geezyx authored Jan 4, 2023
1 parent 6faa553 commit 2c50628
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 25 deletions.
51 changes: 51 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 2.1
orbs:
ruby: circleci/[email protected]
jobs:
test:
docker:
- image: cimg/ruby:3.1
environment:
- CC_TEST_REPORTER_ID: d9bc19fd427d76faff759dbca174cce53e5194c40dfd0b6f4d7cbccc1da601ff
steps:
- checkout
- ruby/install-deps
- run:
name: Run tests
command: bundle exec rake
- run:
name: Setup Code Climate test-reporter
command: |
# download test reporter as a static binary
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
command: |
jq 'walk(try .lines // .)' coverage/.resultset.json > coverage/.resultset_fixed.json
./cc-test-reporter format-coverage -t simplecov -o coverage/codeclimate.json coverage/.resultset_fixed.json
./cc-test-reporter upload-coverage
deploy:
docker:
- image: cimg/ruby:3.1
steps:
- checkout
- ruby/install-deps
- run:
name: Publish gem to Rubygems
command: bundle exec rake release
workflows:
version: 2
test-and-deploy:
jobs:
- test:
filters:
tags:
only: /.*/
- deploy:
requires:
- test
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/.bundle
/.yardoc/
/Gemfile.lock
/doc/
/pkg/
/vendor/cache/*.gem
*.gem
/coverage
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ source 'https://rubygems.org'

gemspec

gem 'rake-release'

group :test do
gem "simplecov"
gem "simplecov", "~> 0.21"
gem "codeclimate-test-reporter", "~> 1.0.0"
end

Expand Down
65 changes: 65 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
PATH
remote: .
specs:
whatmask (1.0.8)

GEM
remote: https://rubygems.org/
specs:
codeclimate-test-reporter (1.0.7)
simplecov
diff-lcs (1.5.0)
docile (1.4.0)
io-console (0.6.0)
irb (1.6.2)
reline (>= 0.3.0)
kramdown (2.4.0)
rexml
rake (13.0.6)
rake-release (1.3.0)
bundler (>= 1.11, < 3)
reline (0.3.2)
io-console (~> 0.5)
rexml (3.2.5)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.0)
rubygems-tasks (0.2.5)
irb (~> 1.0)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
webrick (1.7.0)
yard (0.9.28)
webrick (~> 1.7.0)

PLATFORMS
arm64-darwin-21

DEPENDENCIES
bundler (~> 2.3)
codeclimate-test-reporter (~> 1.0.0)
kramdown
rake (~> 13.0.6)
rake-release
rspec (~> 3.12)
rubygems-tasks (~> 0.2)
simplecov (~> 0.21)
whatmask!
yard (~> 0.9)

BUNDLED WITH
2.3.26
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![travis-ci](https://travis-ci.org/geezyx/whatmask.svg?branch=master)
[![Test Coverage](https://codeclimate.com/github/geezyx/whatmask/badges/coverage.svg)](https://codeclimate.com/github/geezyx/whatmask/coverage)
[![Code Climate](https://codeclimate.com/github/geezyx/whatmask/badges/gpa.svg)](https://codeclimate.com/github/geezyx/whatmask)
[![Issue Count](https://codeclimate.com/github/geezyx/whatmask/badges/issue_count.svg)](https://codeclimate.com/github/geezyx/whatmask)
[![Gem Version](https://badge.fury.io/rb/whatmask.svg)](https://badge.fury.io/rb/whatmask)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/geezyx/whatmask/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/geezyx/whatmask/tree/main)
[![Test Coverage](https://api.codeclimate.com/v1/badges/113c95a91a5053c78b7d/test_coverage)](https://codeclimate.com/github/geezyx/whatmask/test_coverage)
[![Maintainability](https://api.codeclimate.com/v1/badges/113c95a91a5053c78b7d/maintainability)](https://codeclimate.com/github/geezyx/whatmask/maintainability)
# Whatmask

Whatmask is a command-line tool originally written by Jim Laffey (http://www.laffeycomputer.com/whatmask.html) and released with a GPL license. This is a ruby rewrite of whatmask, providing the same functionality of the original utility (will maybe add more).
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rescue LoadError => e
end

require 'rake'

require 'rake/release'

require 'rubygems/tasks'
Gem::Tasks.new
Expand Down
12 changes: 6 additions & 6 deletions whatmask.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
gem.version = Whatmask::VERSION
gem.summary = %q{netmask calculator}
gem.description = %q{A ruby adaptation of whatmask http://www.laffeycomputer.com/whatmask.html}
gem.license = "GPL"
gem.license = "LGPL-3.0-or-later"
gem.authors = ["Mike Gee"]
gem.email = "[email protected]"
gem.homepage = "https://github.com/geezyx/whatmask"
Expand All @@ -29,9 +29,9 @@ Gem::Specification.new do |gem|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
gem.require_paths = ['lib']

gem.add_development_dependency 'bundler'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rspec'
gem.add_development_dependency 'rubygems-tasks'
gem.add_development_dependency 'yard'
gem.add_development_dependency 'bundler', '~> 2.3'
gem.add_development_dependency 'rake', '~> 13.0.6'
gem.add_development_dependency 'rspec', '~> 3.12'
gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
gem.add_development_dependency 'yard', '~> 0.9'
end

0 comments on commit 2c50628

Please sign in to comment.