Skip to content

Commit 078b7cf

Browse files
authored
Merge pull request #24 from voxpupuli/modulesync
modulesync
2 parents cda5257 + fbd10e1 commit 078b7cf

File tree

5 files changed

+67
-15
lines changed

5 files changed

+67
-15
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
name: Release
22

33
on:
4-
create:
5-
ref_type: tag
4+
push:
5+
tags:
6+
- '*'
67

78
jobs:
89
release:
910
runs-on: ubuntu-latest
10-
if: github.repository == 'voxpupuli/puppet-lint-trailing_comma-check'
11+
if: github.repository_owner == 'voxpupuli'
1112
steps:
1213
- uses: actions/checkout@v2
1314
- name: Install Ruby 3.0
1415
uses: ruby/setup-ruby@v1
1516
with:
1617
ruby-version: '3.0'
17-
env:
18-
BUNDLE_WITHOUT: release
18+
bundler: 'none'
1919
- name: Build gem
2020
run: gem build *.gemspec
2121
- name: Publish gem to rubygems.org
@@ -28,4 +28,4 @@ jobs:
2828
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
2929
chmod 0600 ~/.gem/credentials
3030
- name: Publish gem to GitHub packages
31-
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
31+
run: gem push --key github --host https://rubygems.pkg.github.com/${{ github.repository_owner }} *.gem

.github/workflows/test.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
ruby:
17-
- "2.4"
18-
- "2.5"
19-
- "2.6"
20-
- "2.7"
21-
- "3.0"
16+
include:
17+
- ruby: "2.4"
18+
- ruby: "2.5"
19+
- ruby: "2.6"
20+
- ruby: "2.7"
21+
- ruby: "3.0"
22+
- ruby: "3.1"
23+
coverage: "yes"
24+
env:
25+
COVERAGE: ${{ matrix.coverage }}
26+
name: Ruby ${{ matrix.ruby }}
2227
steps:
2328
- uses: actions/checkout@v2
2429
- name: Install Ruby ${{ matrix.ruby }}
@@ -28,3 +33,5 @@ jobs:
2833
bundler-cache: true
2934
- name: Run tests
3035
run: bundle exec rake spec
36+
- name: Verify gem builds
37+
run: gem build *.gemspec

Gemfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
source 'https://rubygems.org'
1+
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
22

33
gemspec
44

55
group :release do
6-
gem 'github_changelog_generator', :require => false
6+
gem 'github_changelog_generator', require: false
7+
end
8+
9+
group :coverage, optional: ENV['COVERAGE']!='yes' do
10+
gem 'simplecov-console', :require => false
11+
gem 'codecov', :require => false
712
end

Rakefile

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,18 @@ require 'rspec/core/rake_task'
22

33
RSpec::Core::RakeTask.new(:spec)
44

5-
task :default => :spec
5+
task default: :spec
6+
7+
begin
8+
require 'rubygems'
9+
require 'github_changelog_generator/task'
10+
11+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
12+
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file."
13+
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix skip-changelog modulesync}
14+
config.user = 'voxpupuli'
15+
config.project = 'puppet-lint-trailing_comma-check'
16+
config.future_release = Gem::Specification.load("#{config.project}.gemspec").version
17+
end
18+
rescue LoadError
19+
end

spec/spec_helper.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# frozen_string_literal: true
2+
3+
begin
4+
require 'simplecov'
5+
require 'simplecov-console'
6+
require 'codecov'
7+
rescue LoadError
8+
else
9+
SimpleCov.start do
10+
track_files 'lib/**/*.rb'
11+
12+
add_filter '/spec'
13+
14+
enable_coverage :branch
15+
16+
# do not track vendored files
17+
add_filter '/vendor'
18+
add_filter '/.vendor'
19+
end
20+
21+
SimpleCov.formatters = [
22+
SimpleCov::Formatter::Console,
23+
SimpleCov::Formatter::Codecov,
24+
]
25+
end
26+
127
require 'puppet-lint'
228

329
PuppetLint::Plugins.load_spec_helper

0 commit comments

Comments
 (0)