-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from jan-win1993/add-github-actions
Add Github Actions & acceptance tests & update pdk
- Loading branch information
Showing
8 changed files
with
209 additions
and
19 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
fixtures: | ||
forge_modules: | ||
concat: "puppetlabs/concat" | ||
stdlib: "puppetlabs/stdlib" | ||
repositories: | ||
concat: "https://github.com/puppetlabs/puppetlabs-concat.git" | ||
facts: "https://github.com/puppetlabs/puppetlabs-facts.git" | ||
provision: "https://github.com/puppetlabs/provision.git" | ||
puppet_agent: "https://github.com/puppetlabs/puppetlabs-puppet_agent.git" | ||
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git" | ||
symlinks: | ||
proftpd: "#{source_dir}" |
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,72 @@ | ||
--- | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
puppet_version: [6,7] | ||
|
||
name: Check / Puppet ${{ matrix.puppet_version }} | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run pdk validate | ||
uses: puppets-epic-show-theatre/action-pdk-validate@v1 | ||
with: | ||
puppet-version: ${{ matrix.puppet_version }} | ||
|
||
- name: Run pdk test unit | ||
uses: puppets-epic-show-theatre/action-pdk-test-unit@v1 | ||
with: | ||
puppet-version: ${{ matrix.puppet_version }} | ||
|
||
acceptance: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
#os: [ 'el7', 'el8', 'el8_stream', 'rocky8', 'alma8', 'el9_stream' 'deb10', 'deb11','ub2004', 'ub2204' ] | ||
os: [ 'el8', 'rocky8' ] | ||
puppet_version: [6,7] | ||
|
||
name: Acceptance / ${{ matrix.os }} / Puppet ${{ matrix.puppet_version }} | ||
runs-on: ubuntu-20.04 | ||
needs: | ||
- check | ||
|
||
steps: | ||
- name: Enable IPv6 on docker | ||
run: | | ||
echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json | ||
sudo service docker restart | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.7" | ||
bundler-cache: true | ||
|
||
- name: Run Litmus | ||
env: | ||
DEBUG: true | ||
run: | | ||
bundle exec rake 'litmus:provision_list[gha_${{ matrix.os }}]' | ||
bundle exec rake 'litmus:install_agent[puppet${{ matrix.puppet_version }}]' | ||
bundle exec rake litmus:install_module | ||
bundle exec rake litmus:acceptance:parallel | ||
- name: Cleanup | ||
run: | | ||
bundle exec rake 'litmus:tear_down' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
default: | ||
provisioner: docker_exp | ||
images: ['waffleimage/centos7'] | ||
vagrant: | ||
provisioner: vagrant | ||
images: ['centos/7', 'generic/ubuntu2004'] | ||
|
||
deb_all: | ||
provisioner: docker | ||
images: ['litmusimage/debian:10', 'litmusimage/debian:11'] | ||
el_all: | ||
provisioner: docker | ||
images: ['litmusimage/centos:7', 'litmusimage/centos:8'] | ||
# The most reliable workaround for the docker/systemd incompatibility. | ||
# see https://github.com/docker/for-linux/issues/835 | ||
# see https://github.com/moby/moby/issues/38749 | ||
vars: '{docker_run_opts: ["-v /sys/fs/cgroup:/sys/fs/cgroup:ro"]}' | ||
ub_all: | ||
provisioner: docker | ||
images: ['litmusimage/ubuntu:20.04', 'litmusimage/ubuntu:20.04', 'litmusimage/ubuntu:22.04'] | ||
|
||
gha_deb10: | ||
provisioner: docker | ||
images: ['litmusimage/debian:10'] | ||
gha_deb11: | ||
provisioner: docker | ||
images: ['litmusimage/debian:11'] | ||
gha_el7: | ||
provisioner: docker | ||
images: ['litmusimage/centos:7'] | ||
# The most reliable workaround for the docker/systemd incompatibility. | ||
# see https://github.com/docker/for-linux/issues/835 | ||
# see https://github.com/moby/moby/issues/38749 | ||
vars: '{docker_run_opts: ["-v /sys/fs/cgroup:/sys/fs/cgroup:ro"]}' | ||
gha_el8: | ||
provisioner: docker | ||
images: ['litmusimage/centos:8'] | ||
# The most reliable workaround for the docker/systemd incompatibility. | ||
# see https://github.com/docker/for-linux/issues/835 | ||
# see https://github.com/moby/moby/issues/38749 | ||
#vars: '{docker_run_opts: ["-v /sys/fs/cgroup:/sys/fs/cgroup:ro"]}' | ||
gha_el8_stream: | ||
provisioner: docker | ||
images: ['litmusimage/centos:stream8'] | ||
gha_el9_stream: | ||
provisioner: docker | ||
images: ['litmusimage/centos:stream9'] | ||
gha_rocky8: | ||
provisioner: docker | ||
images: ['litmusimage/rockylinux:8'] | ||
gha_alma8: | ||
provisioner: docker | ||
images: ['litmusimage/almalinux:8'] | ||
# The most reliable workaround for the docker/systemd incompatibility. | ||
# see https://github.com/docker/for-linux/issues/835 | ||
# see https://github.com/moby/moby/issues/38749 | ||
#vars: '{docker_run_opts: ["-v /sys/fs/cgroup:/sys/fs/cgroup:ro"]}' | ||
gha_ub1804: | ||
provisioner: docker | ||
images: ['litmusimage/ubuntu:18.04'] | ||
gha_ub2004: | ||
provisioner: docker | ||
images: ['litmusimage/ubuntu:20.04'] | ||
gha_ub2204: | ||
provisioner: docker | ||
images: ['litmusimage/ubuntu:22.04'] |
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,16 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'proftpd class' do | ||
context 'default parameters' do | ||
it 'is expected to work idempotently with no errors' do | ||
pp = <<-EOS | ||
if $facts['os']['family'] == 'RedHat' { | ||
include epel | ||
} | ||
class { 'proftpd': } | ||
EOS | ||
# Run it twice and test for idempotency | ||
idempotent_apply(pp) | ||
end | ||
end | ||
end |
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,6 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'puppet_litmus' | ||
require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb')) | ||
|
||
PuppetLitmus.configure! |
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,17 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'puppet_litmus' | ||
require 'singleton' | ||
|
||
class LitmusHelper | ||
include Singleton | ||
include PuppetLitmus | ||
end | ||
|
||
RSpec.configure do |c| | ||
c.before :suite do | ||
puts 'Running acceptance test with Puppet module puppet-epel installed' | ||
# Install soft dependencies. | ||
LitmusHelper.instance.run_shell('puppet module install puppet/epel') | ||
end | ||
end |