-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(MODULES-10806) Add Github Actions workflows
Added GitHub Actions workflows for `Static Code Analysis` and `Unit Tests` that run each time there is a new `pull request` or `git push`. `Unit tests` are also set to run every workday at `05:00:00 UTC`. More info to be added. In preparation for the Puppet 7 release, the `puppet-module-posix-dev-r2.7` and `puppet-module-posix-dev-r2.7` gems had to be removed from `Gemfile` due to the following dependency error: `puppet-module-posix-dev-r2.7` depends on `puppet_litmus` which depends on `bolt` which depends on `puppet` which is locked to a version below 7. Also added the needed gems that were lost in the above removal process and adapted the `puppet-blacksmith` version restrictions accordingly.
- Loading branch information
1 parent
7467d0a
commit 8e35b3f
Showing
8 changed files
with
281 additions
and
62 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
name: '[Daily] Unit Tests with nightly Puppet gem' | ||
|
||
on: | ||
schedule: | ||
- cron: '0 5 * * 1-5' | ||
|
||
jobs: | ||
daily_unit_tests_with_nightly_puppet_gem: | ||
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }} | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ] | ||
puppet_version: [ 5, 6, 7 ] | ||
include: | ||
- puppet_version: 5 | ||
ruby: 2.4 | ||
- puppet_version: 6 | ||
ruby: 2.5 | ||
- puppet_version: 7 | ||
ruby: 2.7 | ||
|
||
- os: 'ubuntu-18.04' | ||
os_type: 'Linux' | ||
env_set_cmd: 'export ' | ||
gem_file: 'puppet-latest.gem' | ||
- os: 'macos-10.15' | ||
os_type: 'macOS' | ||
env_set_cmd: 'export ' | ||
gem_file: 'puppet-latest-universal-darwin.gem' | ||
- os: 'windows-2019' | ||
os_type: 'Windows' | ||
env_set_cmd: '$env:' | ||
gem_file: 'puppet-latest-x64-mingw32.gem' | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install ruby version ${{ matrix.ruby }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
|
||
- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem | ||
run: | | ||
curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem | ||
gem install puppet.gem -N | ||
- name: Prepare testing environment with bundler | ||
run: | | ||
bundle config set system 'true' | ||
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]') | ||
bundle update --jobs 4 --retry 3 | ||
- name: Run unit tests | ||
run: bundle exec rake parallel_spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
name: Static Code Analysis | ||
|
||
on: | ||
push: | ||
branches: [ MODULES-10806 ] | ||
pull_request: | ||
branches: [ MODULES-10806 ] | ||
|
||
jobs: | ||
static_code_analysis: | ||
name: Run checks | ||
|
||
env: | ||
ruby_version: 2.5 | ||
|
||
runs-on: 'ubuntu-18.04' | ||
continue-on-error: true | ||
steps: | ||
- name: Checkout current PR code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install ruby version ${{ env.ruby_version }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ env.ruby_version }} | ||
|
||
- name: Prepare testing environment with bundler | ||
run: bundle update --jobs 4 --retry 3 | ||
|
||
- name: Run rake -t | ||
run: bundle exec rake -t | ||
|
||
- name: Run commits check | ||
run: bundle exec rake commits | ||
|
||
- name: Run validate check | ||
run: bundle exec rake validate | ||
|
||
- name: Run lint check | ||
run: bundle exec rake lint | ||
|
||
- name: Run metadata_lint check | ||
run: bundle exec rake metadata_lint | ||
|
||
- name: Run rubocop check | ||
run: bundle exec rake rubocop | ||
|
||
- name: Run syntax check | ||
run: bundle exec rake syntax syntax:hiera syntax:manifests syntax:templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
name: Unit Tests with nightly Puppet gem | ||
|
||
on: | ||
push: | ||
branches: [ MODULES-10806 ] | ||
pull_request: | ||
branches: [ MODULES-10806 ] | ||
|
||
jobs: | ||
unit_tests_with_nightly_puppet_gem: | ||
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }} | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ] | ||
puppet_version: [ 5, 6, 7 ] | ||
include: | ||
- puppet_version: 5 | ||
ruby: 2.4 | ||
- puppet_version: 6 | ||
ruby: 2.5 | ||
- puppet_version: 7 | ||
ruby: 2.7 | ||
|
||
- os: 'ubuntu-18.04' | ||
os_type: 'Linux' | ||
env_set_cmd: 'export ' | ||
gem_file: 'puppet-latest.gem' | ||
- os: 'macos-10.15' | ||
os_type: 'macOS' | ||
env_set_cmd: 'export ' | ||
gem_file: 'puppet-latest-universal-darwin.gem' | ||
- os: 'windows-2019' | ||
os_type: 'Windows' | ||
env_set_cmd: '$env:' | ||
gem_file: 'puppet-latest-x64-mingw32.gem' | ||
|
||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
steps: | ||
- name: Checkout current PR code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install ruby version ${{ matrix.ruby }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
|
||
- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem | ||
run: | | ||
curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem | ||
gem install puppet.gem -N | ||
- name: Prepare testing environment with bundler | ||
run: | | ||
bundle config set system 'true' | ||
${{ matrix.env_set_cmd }}PUPPET_GEM_VERSION=$(ruby -e 'puts /puppet\s+\((.+)\)/.match(`gem list -eld puppet`)[1]') | ||
bundle update --jobs 4 --retry 3 | ||
- name: Run unit tests | ||
run: bundle exec rake parallel_spec |
49 changes: 49 additions & 0 deletions
49
.github/workflows/unit_tests_with_released_puppet_gem.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
name: Unit Tests with released Puppet gem | ||
|
||
on: | ||
push: | ||
branches: [ MODULES-10806 ] | ||
pull_request: | ||
branches: [ MODULES-10806 ] | ||
|
||
jobs: | ||
unit_tests_with_released_puppet_gem: | ||
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }} | ||
strategy: | ||
matrix: | ||
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2019' ] | ||
puppet_version: [ 5, 6 ] | ||
include: | ||
- puppet_version: 5 | ||
ruby: 2.4 | ||
- puppet_version: 6 | ||
ruby: 2.5 | ||
|
||
- os: 'ubuntu-18.04' | ||
os_type: 'Linux' | ||
- os: 'macos-10.15' | ||
os_type: 'macOS' | ||
- os: 'windows-2019' | ||
os_type: 'Windows' | ||
|
||
runs-on: ${{ matrix.os }} | ||
continue-on-error: true | ||
env: | ||
PUPPET_GEM_VERSION: ~> ${{ matrix.puppet_version }}.0 | ||
steps: | ||
- name: Checkout current PR code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install ruby version ${{ matrix.ruby }} | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby }} | ||
|
||
- name: Prepare testing environment with bundler | ||
run: | | ||
bundle config set system 'true' | ||
bundle update --jobs 4 --retry 3 | ||
- name: Run unit tests | ||
run: bundle exec rake parallel_spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.