Skip to content

Commit e80cef7

Browse files
authored
Merge pull request #39 from luchihoratiu/maint-github-actions-fixes
2 parents f64d389 + b1f95c0 commit e80cef7

6 files changed

+38
-6
lines changed

.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
1111
strategy:
1212
matrix:
13-
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
13+
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
1414
puppet_version: [ 5, 6, 7 ]
1515
include:
1616
- puppet_version: 5
@@ -28,7 +28,7 @@ jobs:
2828
os_type: 'macOS'
2929
env_set_cmd: 'export '
3030
gem_file: 'puppet-latest-universal-darwin.gem'
31-
- os: 'windows-2019'
31+
- os: 'windows-2016'
3232
os_type: 'Windows'
3333
env_set_cmd: '$env:'
3434
gem_file: 'puppet-latest-x64-mingw32.gem'

.github/workflows/static_code_analysis.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- name: Checkout current PR code
2121
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 0
2224

2325
- name: Install ruby version ${{ env.ruby_version }}
2426
uses: ruby/setup-ruby@v1
@@ -28,6 +30,9 @@ jobs:
2830
- name: Prepare testing environment with bundler
2931
run: bundle update --jobs 4 --retry 3
3032

33+
- name: Run commits check
34+
run: bundle exec rake commits
35+
3136
- name: Run rubocop check
3237
run: bundle exec rake ${{ env.extra_checks }} rubocop
3338

.github/workflows/unit_tests_with_nightly_puppet_gem.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
1313
strategy:
1414
matrix:
15-
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
15+
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
1616
puppet_version: [ 5, 6, 7 ]
1717
include:
1818
- puppet_version: 5
@@ -30,7 +30,7 @@ jobs:
3030
os_type: 'macOS'
3131
env_set_cmd: 'export '
3232
gem_file: 'puppet-latest-universal-darwin.gem'
33-
- os: 'windows-2019'
33+
- os: 'windows-2016'
3434
os_type: 'Windows'
3535
env_set_cmd: '$env:'
3636
gem_file: 'puppet-latest-x64-mingw32.gem'

.github/workflows/unit_tests_with_released_puppet_gem.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
1313
strategy:
1414
matrix:
15-
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
15+
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
1616
puppet_version: [ 5, 6 ]
1717
include:
1818
- puppet_version: 5
@@ -24,7 +24,7 @@ jobs:
2424
os_type: 'Linux'
2525
- os: 'macos-10.15'
2626
os_type: 'macOS'
27-
- os: 'windows-2019'
27+
- os: 'windows-2016'
2828
os_type: 'Windows'
2929

3030
runs-on: ${{ matrix.os }}

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ group :system_tests do
4545
gem "beaker-pe", require: false
4646
gem "beaker-hostgenerator"
4747
gem "beaker-rspec"
48+
gem "pdk", '~> 1.18', platforms: [:ruby]
49+
gem "puppet-blacksmith", '~> 3.4', require: false
4850
end
4951

5052
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,28 @@ EOM
8585
end
8686
end
8787

88+
desc "verify that commit messages match CONTRIBUTING.md requirements"
89+
task(:commits) do
90+
# This rake task looks at the summary from every commit from this branch not
91+
# in the branch targeted for a PR.
92+
commit_range = 'HEAD^..HEAD'
93+
puts "Checking commits #{commit_range}"
94+
%x{git log --no-merges --pretty=%s #{commit_range}}.each_line do |commit_summary|
95+
# This regex tests for the currently supported commit summary tokens.
96+
# The exception tries to explain it in more full.
97+
if /^\((maint|packaging|doc|docs|modules-\d+)\)|revert/i.match(commit_summary).nil?
98+
raise "\n\n\n\tThis commit summary didn't match CONTRIBUTING.md guidelines:\n" \
99+
"\n\t\t#{commit_summary}\n" \
100+
"\tThe commit summary (i.e. the first line of the commit message) should start with one of:\n" \
101+
"\t\t(MODULES-<digits>) # this is most common and should be a ticket at tickets.puppet.com\n" \
102+
"\t\t(docs)\n" \
103+
"\t\t(docs)(DOCUMENT-<digits>)\n" \
104+
"\t\t(packaging)\n"
105+
"\t\t(maint)\n" \
106+
"\n\tThis test for the commit summary is case-insensitive.\n\n\n"
107+
else
108+
puts "#{commit_summary}"
109+
end
110+
puts "...passed"
111+
end
112+
end

0 commit comments

Comments
 (0)