Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@ fixtures:
repositories:
inifile: 'https://github.com/puppetlabs/puppetlabs-inifile.git'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
postgresql: 'https://github.com/puppetlabs/puppet-postgresql.git'
firewall: 'https://github.com/puppetlabs/puppetlabs-firewall.git'
apt: 'https://github.com/puppetlabs/puppetlabs-apt.git'
concat: 'https://github.com/puppetlabs/puppetlabs-concat.git'
file_concat: 'https://github.com/electrical/puppet-lib-file_concat.git'
systemd: 'https://github.com/camptocamp/puppet-systemd.git'
cron: 'https://github.com/voxpupuli/puppet-cron.git'
provision: 'https://github.com/puppetlabs/provision.git'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
facts: 'https://github.com/puppetlabs/puppetlabs-facts.git'
cron_core: 'https://github.com/puppetlabs/puppetlabs-cron_core.git'
yumrepo_core: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core.git'
augeas_core: 'https://github.com/puppetlabs/puppetlabs-augeas_core.git'
postgresql: 'https://github.com/puppetlabs/puppetlabs-postgresql.git'
firewall: 'https://github.com/puppetlabs/puppetlabs-firewall.git'
forge_modules:
postgresql:
repo: 'puppetlabs/postgresql'
ref: "9.2.0"
firewall:
repo: 'puppetlabs/firewall'
ref: "6.0.0"
symlinks:
puppetdb: '#{source_dir}'
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "ci"

on:
pull_request:
branches:
- "main"
paths-ignore:
- '**.md'
- 'examples/**'
- 'LICENSE'
- 'CODEOWNERS'
- 'AUTHORS'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Spec:
uses: ./.github/workflows/module_ci.yml
secrets: inherit
86 changes: 86 additions & 0 deletions .github/workflows/module_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This is a generic workflow for Puppet module CI operations.
name: "Module CI"

on:
workflow_call:
inputs:
runs_on:
description: "The operating system used for the runner."
required: false
default: "ubuntu-latest"
type: "string"
flags:
description: "Additional flags to pass to matrix_from_metadata_v2."
required: false
default: ''
type: "string"

jobs:
setup_matrix:
name: "Setup Test Matrix"
runs-on: ${{ inputs.runs_on }}
outputs:
spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }}

steps:

- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: "Setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: "2.7"
bundler-cache: true

- name: "Bundle environment"
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::

- name: Setup Spec Test Matrix
id: get-matrix
run: |
bundle exec matrix_from_metadata_v2 ${{ inputs.flags }}

spec:
name: "Spec tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})"
needs: "setup_matrix"
runs-on: ${{ inputs.runs_on }}
strategy:
fail-fast: false
matrix: ${{ fromJson( needs.setup_matrix.outputs.spec_matrix ) }}

env:
PUPPET_GEM_VERSION: ${{ matrix.puppet_version }}
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' # why is this set?

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: "Setup ruby"
uses: "ruby/setup-ruby@v1"
with:
ruby-version: ${{matrix.ruby_version}}
bundler-cache: true

- name: "Bundle environment"
run: |
echo ::group::bundler environment
bundle env
echo ::endgroup::

- name: "Run Static & Syntax Tests"
run: |
bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop
bundle exec dependency-checker metadata.json || true # temporarily allow to fail

- name: "Run tests"
run: |
bundle exec rake parallel_spec
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
Expand All @@ -25,3 +25,4 @@
.project
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
18 changes: 13 additions & 5 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/log/
/pkg/
/spec/fixtures/manifests/
/spec/fixtures/modules/
/spec/fixtures/modules/*
/tmp/
/vendor/
/convert_report.txt
Expand All @@ -25,18 +25,26 @@
.project
.envrc
/inventory.yaml
/appveyor.yml
/spec/fixtures/litmus_inventory.yaml
/.fixtures.yml
/Gemfile
/.gitattributes
/.github/
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/..yml
/.yardopts
/spec/
/.vscode/
/.sync.yml
/.devcontainer/
/.*.yml
/pdk.yaml
/.pmtignore
/.git*
/.editorconfig
/provision.yaml
4 changes: 4 additions & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
--relative
--no-parameter_types-check
--no-parameter_documentation-check
--no-documentation-check
--no-140chars-check
1 change: 1 addition & 0 deletions .rspec_parallel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--format progress
Loading