Skip to content

Commit 8683821

Browse files
authored
Merge pull request #37 from luchihoratiu/MODULES-10800
(MODULES-10800) Add GitHub Actions workflows
2 parents 9a9468b + 7094bff commit 8683821

8 files changed

+221
-103
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: '[Daily] Unit Tests with nightly Puppet gem'
3+
4+
on:
5+
schedule:
6+
- cron: '0 5 * * 1-5'
7+
8+
jobs:
9+
daily_unit_tests_with_nightly_puppet_gem:
10+
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
11+
strategy:
12+
matrix:
13+
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
14+
puppet_version: [ 5, 6, 7 ]
15+
include:
16+
- puppet_version: 5
17+
ruby: 2.4
18+
- puppet_version: 6
19+
ruby: 2.5
20+
- puppet_version: 7
21+
ruby: 2.7
22+
23+
- os: 'ubuntu-18.04'
24+
os_type: 'Linux'
25+
env_set_cmd: 'export '
26+
gem_file: 'puppet-latest.gem'
27+
- os: 'macos-10.15'
28+
os_type: 'macOS'
29+
env_set_cmd: 'export '
30+
gem_file: 'puppet-latest-universal-darwin.gem'
31+
- os: 'windows-2019'
32+
os_type: 'Windows'
33+
env_set_cmd: '$env:'
34+
gem_file: 'puppet-latest-x64-mingw32.gem'
35+
36+
runs-on: ${{ matrix.os }}
37+
steps:
38+
- name: Checkout code
39+
uses: actions/checkout@v2
40+
41+
- name: Install ruby version ${{ matrix.ruby }}
42+
uses: ruby/setup-ruby@v1
43+
with:
44+
ruby-version: ${{ matrix.ruby }}
45+
46+
- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
47+
run: |
48+
curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem
49+
gem install puppet.gem -N
50+
51+
- name: Prepare testing environment with bundler
52+
run: |
53+
bundle config set system 'true'
54+
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
55+
bundle update --jobs 4 --retry 3
56+
57+
- name: Run unit tests
58+
run: bundle exec rake parallel_spec
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Static Code Analysis
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
static_code_analysis:
12+
name: Run checks
13+
14+
env:
15+
ruby_version: 2.5
16+
extra_checks: check:symlinks check:git_ignore check:dot_underscore check:test_file
17+
18+
runs-on: 'ubuntu-18.04'
19+
steps:
20+
- name: Checkout current PR code
21+
uses: actions/checkout@v2
22+
23+
- name: Install ruby version ${{ env.ruby_version }}
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: ${{ env.ruby_version }}
27+
28+
- name: Prepare testing environment with bundler
29+
run: bundle update --jobs 4 --retry 3
30+
31+
- name: Run rubocop check
32+
run: bundle exec rake ${{ env.extra_checks }} rubocop
33+
34+
- name: Run syntax check
35+
run: bundle exec rake ${{ env.extra_checks }} syntax syntax:hiera syntax:manifests syntax:templates
36+
37+
- name: Run lint check
38+
run: bundle exec rake ${{ env.extra_checks }} lint
39+
40+
- name: Run metadata_lint check
41+
run: bundle exec rake ${{ env.extra_checks }} metadata_lint
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Unit Tests with nightly Puppet gem
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
unit_tests_with_nightly_puppet_gem:
12+
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
13+
strategy:
14+
matrix:
15+
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
16+
puppet_version: [ 5, 6, 7 ]
17+
include:
18+
- puppet_version: 5
19+
ruby: 2.4
20+
- puppet_version: 6
21+
ruby: 2.5
22+
- puppet_version: 7
23+
ruby: 2.7
24+
25+
- os: 'ubuntu-18.04'
26+
os_type: 'Linux'
27+
env_set_cmd: 'export '
28+
gem_file: 'puppet-latest.gem'
29+
- os: 'macos-10.15'
30+
os_type: 'macOS'
31+
env_set_cmd: 'export '
32+
gem_file: 'puppet-latest-universal-darwin.gem'
33+
- os: 'windows-2019'
34+
os_type: 'Windows'
35+
env_set_cmd: '$env:'
36+
gem_file: 'puppet-latest-x64-mingw32.gem'
37+
38+
runs-on: ${{ matrix.os }}
39+
steps:
40+
- name: Checkout current PR code
41+
uses: actions/checkout@v2
42+
43+
- name: Install ruby version ${{ matrix.ruby }}
44+
uses: ruby/setup-ruby@v1
45+
with:
46+
ruby-version: ${{ matrix.ruby }}
47+
48+
- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
49+
run: |
50+
curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem
51+
gem install puppet.gem -N
52+
53+
- name: Prepare testing environment with bundler
54+
run: |
55+
bundle config set system 'true'
56+
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]')
57+
bundle update --jobs 4 --retry 3
58+
59+
- name: Run unit tests
60+
run: bundle exec rake parallel_spec
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Unit Tests with released Puppet gem
3+
4+
on:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
unit_tests_with_released_puppet_gem:
12+
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
13+
strategy:
14+
matrix:
15+
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ]
16+
puppet_version: [ 5, 6 ]
17+
include:
18+
- puppet_version: 5
19+
ruby: 2.4
20+
- puppet_version: 6
21+
ruby: 2.5
22+
23+
- os: 'ubuntu-18.04'
24+
os_type: 'Linux'
25+
- os: 'macos-10.15'
26+
os_type: 'macOS'
27+
- os: 'windows-2019'
28+
os_type: 'Windows'
29+
30+
runs-on: ${{ matrix.os }}
31+
env:
32+
PUPPET_GEM_VERSION: ~> ${{ matrix.puppet_version }}.0
33+
steps:
34+
- name: Checkout current PR code
35+
uses: actions/checkout@v2
36+
37+
- name: Install ruby version ${{ matrix.ruby }}
38+
uses: ruby/setup-ruby@v1
39+
with:
40+
ruby-version: ${{ matrix.ruby }}
41+
42+
- name: Prepare testing environment with bundler
43+
run: |
44+
bundle config set system 'true'
45+
bundle update --jobs 4 --retry 3
46+
47+
- name: Run unit tests
48+
run: bundle exec rake parallel_spec

.travis.yml

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

Gemfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
1717
minor_version = ruby_version_segments[0..1].join('.')
1818

1919
group :development do
20+
gem "parallel_tests", '>= 2.14.1', '< 2.14.3', require: false
21+
gem "metadata-json-lint", '>= 2.0.2', '< 3.0.0', require: false
22+
gem "rspec-puppet-facts", '~> 1.10.0', require: false
23+
gem "rspec_junit_formatter", '~> 0.2', require: false
24+
gem "rubocop", '~> 0.49.0', require: false
25+
gem "rubocop-rspec", '~> 1.16.0', require: false
26+
gem "rubocop-i18n", '~> 1.2.0', require: false
27+
gem "puppetlabs_spec_helper", '>= 2.9.0', '< 3.0.0', require: false
2028
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
2129
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
2230
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
@@ -25,9 +33,7 @@ group :development do
2533
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
2634
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
2735
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
28-
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
2936
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
30-
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3137
gem "puppet-strings", require: false
3238
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
3339
end

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11

22
# sshkeys_core
33

4+
[![Modules Status](https://github.com/puppetlabs/puppetlabs-sshkeys_core/workflows/%5BDaily%5D%20Unit%20Tests%20with%20nightly%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-sshkeys_core/actions)
5+
[![Modules Status](https://github.com/puppetlabs/puppetlabs-sshkeys_core/workflows/Static%20Code%20Analysis/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-sshkeys_core/actions)
6+
[![Modules Status](https://github.com/puppetlabs/puppetlabs-sshkeys_core/workflows/Unit%20Tests%20with%20nightly%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-sshkeys_core/actions)
7+
[![Modules Status](https://github.com/puppetlabs/puppetlabs-sshkeys_core/workflows/Unit%20Tests%20with%20released%20Puppet%20gem/badge.svg?branch=main)](https://github.com/puppetlabs/puppetlabs-sshkeys_core/actions)
8+
9+
410
## Table of Contents
511

612
1. [Description](#description)

appveyor.yml

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

0 commit comments

Comments
 (0)