Skip to content

Commit 6cb7cee

Browse files
committed
modulesync 2021-07-24
1 parent f4c0056 commit 6cb7cee

File tree

7 files changed

+120
-20
lines changed

7 files changed

+120
-20
lines changed

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
if: github.repository_owner == 'voxpupuli'
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Install Ruby 3.0
15+
uses: ruby/setup-ruby@v1
16+
with:
17+
ruby-version: '3.0'
18+
env:
19+
BUNDLE_WITHOUT: release
20+
- name: Build gem
21+
run: gem build *.gemspec
22+
- name: Publish gem to rubygems.org
23+
run: gem push *.gem
24+
env:
25+
GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
26+
- name: Setup GitHub packages access
27+
run: |
28+
mkdir -p ~/.gem
29+
echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
30+
chmod 0600 ~/.gem/credentials
31+
- name: Publish gem to GitHub packages
32+
run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
env:
8+
BUNDLE_WITHOUT: release
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- ruby: "2.4"
18+
- ruby: "2.5"
19+
- ruby: "2.6"
20+
- ruby: "2.7"
21+
- ruby: "3.0"
22+
coverage: "yes"
23+
env:
24+
COVERAGE: ${{ matrix.coverage }}
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Install Ruby ${{ matrix.ruby }}
28+
uses: ruby/setup-ruby@v1
29+
with:
30+
ruby-version: ${{ matrix.ruby }}
31+
bundler-cache: true
32+
- name: Run tests
33+
run: bundle exec rake spec
34+
- name: Verify gem builds
35+
run: gem build *.gemspec

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/.bundle/
2-
/vendor/
2+
/vendor/gems/
33
/Gemfile.lock
4-
puppet-lint-strict_indent-check-*.gem
5-
*.swp
6-
*.swo
4+
vendor/bundle
5+
.vendor/

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

Gemfile

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

33
gemspec
4+
5+
group :release do
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
12+
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-strict_indent-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: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1-
require 'simplecov'
2-
SimpleCov.start
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
326

427
require 'puppet-lint'
528

0 commit comments

Comments
 (0)