Skip to content

Commit

Permalink
PDK update, move CI to GH Actions
Browse files Browse the repository at this point in the history
This includes many changes that are a byproduct of updating to the
latest version of the PDK. All unit tests pass at this stage but
several RuboCop tests still fail.

Tht GH Action was copied from a Vox Pupuli module.
Their module testing is pretty slick and utilizes Beaker just as this
one has traditionally done so it seems like a good place to start. A
couple of lines were commented out as the Gemfile from the PDK doesn't
line up exactly with the one used by most Vox Pupuli modules.

RuboCop is disabled for the moment as it is known that those tests do
not yet pass.
  • Loading branch information
genebean committed May 11, 2021
1 parent 0c9992a commit 2367f7b
Show file tree
Hide file tree
Showing 59 changed files with 3,469 additions and 2,444 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM puppet/pdk:latest

# [Optional] Uncomment this section to install additional packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
{
"name": "Puppet Development Kit (Community)",
"dockerFile": "Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pdk --version",
}
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: CI

on: pull_request

jobs:
setup_matrix:
name: 'Setup Test Matrix'
runs-on: ubuntu-latest
timeout-minutes: 40
outputs:
beaker_setfiles: ${{ steps.get-outputs.outputs.beaker_setfiles }}
puppet_major_versions: ${{ steps.get-outputs.outputs.puppet_major_versions }}
puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
# env:
# BUNDLE_WITHOUT: development:release
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run rake validate
run: bundle exec rake validate
# - name: Run rake rubocop
# run: bundle exec rake rubocop
- name: Setup Test Matrix
id: get-outputs
run: bundle exec metadata2gha --use-fqdn --pidfile-workaround CentOS,Ubuntu

unit:
needs: setup_matrix
runs-on: ubuntu-latest
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
env:
# BUNDLE_WITHOUT: development:system_tests:release
PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run tests
run: bundle exec rake

acceptance:
needs: setup_matrix
runs-on: ubuntu-latest
env:
LANG: en_US
LC_ALL: en_US.UTF-8
# BUNDLE_WITHOUT: development:test:release
strategy:
fail-fast: false
matrix:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Run tests
run: bundle exec rake beaker
env:
BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
BEAKER_setfile: ${{ matrix.setfile.value }}
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.git/
.*.sw[op]
.metadata
.rspec_system
.yardoc
.yardwarns
*.iml
Expand All @@ -20,7 +19,9 @@
/spec/fixtures/modules/
/tmp/
/vendor/
/.vendor/
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
21 changes: 21 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,24 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
/.gitattributes
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
2 changes: 2 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--fail-on-warnings
--relative
Loading

0 comments on commit 2367f7b

Please sign in to comment.