Skip to content

Commit

Permalink
publish gems to github; add badges to README.md
Browse files Browse the repository at this point in the history
Co-authored-by: Ewoud Kohl van Wijngaarden <[email protected]>
  • Loading branch information
bastelfreak and ekohl committed Jul 20, 2021
1 parent c8f7409 commit b72e5fd
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 11 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
name: Release

on:
create:
ref_type: tag
push:
tags:
- '*'

jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'voxpupuli/voxpupuli-test'
if: github.repository_owner == 'voxpupuli'
steps:
- uses: actions/checkout@v2
- name: Install Ruby 2.7
- name: Install Ruby 3.0
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
ruby-version: '3.0'
env:
BUNDLE_WITHOUT: release
- name: Build gem
run: gem build *.gemspec
- name: Publish gem
- name: Publish gem to rubygems.org
run: gem push *.gem
env:
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
- name: Setup GitHub packages access
run: |
mkdir -p ~/.gem
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
chmod 0600 ~/.gem/credentials
- name: Publish gem to GitHub packages
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby:
- "2.4"
- "2.5"
- "2.6"
- "2.7"
include:
- ruby: "2.4"
- ruby: "2.5"
- ruby: "2.6"
- ruby: "2.7"
- ruby: "3.0"
coverage: "yes"
env:
COVERAGE: ${{ matrix.coverage }}
steps:
- uses: actions/checkout@v2
- name: Install Ruby ${{ matrix.ruby }}
Expand Down
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ gemspec
group :release do
gem 'github_changelog_generator', :require => false
end

group :coverage, optional: ENV['COVERAGE']!='yes' do
gem 'simplecov-console', :require => false
gem 'codecov', :require => false
end
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Voxpupuli Test Gem

[![License](https://img.shields.io/github/license/voxpupuli/voxpupuli-test.svg)](https://github.com/voxpupuli/voxpupuli-test/blob/master/LICENSE)
[![Test](https://github.com/voxpupuli/voxpupuli-test/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/voxpupuli-test/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/voxpupuli/voxpupuli-test/branch/master/graph/badge.svg?token=Mypkl78hvK)](https://codecov.io/gh/voxpupuli/voxpupuli-test)
[![Release](https://github.com/voxpupuli/voxpupuli-test/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/voxpupuli-test/actions/workflows/release.yml)
[![RubyGem Version](https://img.shields.io/gem/v/voxpupuli-test.svg)](https://rubygems.org/gems/voxpupuli-test)
[![RubyGem Downloads](https://img.shields.io/gem/dt/voxpupuli-test.svg)](https://rubygems.org/gems/voxpupuli-test)

This is a helper Gem to test the various Vox Pupuli Puppet modules. This Gem currently serves only to encapsulate common `rake` tasks related to releasing modules. The aim is to reduce the boiler plate and need for modulesync.

# Usage
Expand Down
24 changes: 24 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
begin
require 'simplecov'
require 'simplecov-console'
require 'codecov'
rescue LoadError
else
SimpleCov.start do
track_files 'lib/**/*.rb'

add_filter '/spec'

enable_coverage :branch

# do not track vendored files
add_filter '/vendor'
add_filter '/.vendor'
end

SimpleCov.formatters = [
SimpleCov::Formatter::Console,
SimpleCov::Formatter::Codecov,
]
end

require 'rspec/core'

0 comments on commit b72e5fd

Please sign in to comment.