File tree Expand file tree Collapse file tree 5 files changed +67
-15
lines changed Expand file tree Collapse file tree 5 files changed +67
-15
lines changed Original file line number Diff line number Diff line change 1
1
name : Release
2
2
3
3
on :
4
- create :
5
- ref_type : tag
4
+ push :
5
+ tags :
6
+ - ' *'
6
7
7
8
jobs :
8
9
release :
9
10
runs-on : ubuntu-latest
10
- if : github.repository == 'voxpupuli/puppet-lint-trailing_comma-check '
11
+ if : github.repository_owner == 'voxpupuli'
11
12
steps :
12
13
- uses : actions/checkout@v2
13
14
- name : Install Ruby 3.0
14
15
uses : ruby/setup-ruby@v1
15
16
with :
16
17
ruby-version : ' 3.0'
17
- env :
18
- BUNDLE_WITHOUT : release
18
+ bundler : ' none'
19
19
- name : Build gem
20
20
run : gem build *.gemspec
21
21
- name : Publish gem to rubygems.org
28
28
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
29
29
chmod 0600 ~/.gem/credentials
30
30
- 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
Original file line number Diff line number Diff line change @@ -13,12 +13,17 @@ jobs:
13
13
strategy :
14
14
fail-fast : false
15
15
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 }}
22
27
steps :
23
28
- uses : actions/checkout@v2
24
29
- name : Install Ruby ${{ matrix.ruby }}
28
33
bundler-cache : true
29
34
- name : Run tests
30
35
run : bundle exec rake spec
36
+ - name : Verify gem builds
37
+ run : gem build *.gemspec
Original file line number Diff line number Diff line change 1
- source 'https://rubygems.org'
1
+ source ENV [ 'GEM_SOURCE' ] || 'https://rubygems.org'
2
2
3
3
gemspec
4
4
5
5
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
7
12
end
Original file line number Diff line number Diff line change @@ -2,4 +2,18 @@ require 'rspec/core/rake_task'
2
2
3
3
RSpec ::Core ::RakeTask . new ( :spec )
4
4
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 \n All 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
Original file line number Diff line number Diff line change
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
+
1
27
require 'puppet-lint'
2
28
3
29
PuppetLint ::Plugins . load_spec_helper
You can’t perform that action at this time.
0 commit comments