Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update PDK template and workflows #1629

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions .devcontainer/Dockerfile

This file was deleted.

38 changes: 0 additions & 38 deletions .devcontainer/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions .devcontainer/devcontainer.json

This file was deleted.

13 changes: 6 additions & 7 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
fixtures:
repositories:
"stdlib": "https://github.com/puppetlabs/puppetlabs-stdlib"
"cron_core": "https://github.com/puppetlabs/puppetlabs-cron_core.git"
"facts": "https://github.com/puppetlabs/puppetlabs-facts.git"
"provision": "https://github.com/puppetlabs/provision.git"
puppet_agent:
repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
ref: v4.13.0
stdlib: https://github.com/puppetlabs/puppetlabs-stdlib
cron_core: https://github.com/puppetlabs/puppetlabs-cron_core.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
9 changes: 0 additions & 9 deletions .geppetto-rc.json

This file was deleted.

104 changes: 13 additions & 91 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,25 @@
name: "ci"
name: "CI"

on:
pull_request:
branches:
- "main"
workflow_dispatch:


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

jobs:
Spec:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"

setup_matrix:
name: "Setup Test Matrix"
needs: "Spec"
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}

steps:
- name: Checkout Source
uses: actions/checkout@v3

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

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

- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Ubuntu-22.04-arm", "RedHat-9-arm"]'

Acceptance:
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}

runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
PUPPET_GEM_VERSION: '~> 7.24'
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main'

steps:
- name: Checkout Source
uses: actions/checkout@v3

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

- name: Print bundle environment
run: |
bundle env

- name: "Disable mysqld apparmor profile"
if: ${{matrix.platforms.provider == 'docker'}}
run: |
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld
sudo systemctl disable apparmor
sudo systemctl stop apparmor

- name: Provision test environment
run: |
bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
FILE='spec/fixtures/litmus_inventory.yaml'
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true

- name: Install agent
run: |
bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'

- name: Install module
run: |
bundle exec rake 'litmus:install_module'

- name: Run acceptance tests
run: |
bundle exec rake 'litmus:acceptance:parallel'

- name: Remove test environment
if: ${{ always() }}
continue-on-error: true
run: |
bundle exec rake 'litmus:tear_down'
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
secrets: "inherit"
with:
runs_on: ubuntu-20.04
kernel_modules: false
disable_apparmor: true
14 changes: 3 additions & 11 deletions .github/workflows/labeller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ on:

jobs:
label:
runs-on: ubuntu-latest
steps:

- uses: puppetlabs/[email protected]
name: Label issues or pull requests
with:
label_name: community
label_color: '5319e7'
org_membership: puppetlabs
fail_if_member: 'true'
token: ${{ secrets.IAC_COMMUNITY_LABELER }}
if: contains(fromJson('["puppetlabs", "puppet-toy-chest"]'), github.repository_owner)
h0tw1r3 marked this conversation as resolved.
Show resolved Hide resolved
uses: "puppetlabs/cat-github-actions/.github/workflows/labeller.yml@main"
secrets: inherit
96 changes: 7 additions & 89 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,95 +8,13 @@ on:
jobs:
Spec:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
with:
runs_on: "ubuntu-20.04"
secrets: "inherit"

setup_matrix:
name: "Setup Test Matrix"
needs: "Spec"
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.get-matrix.outputs.matrix }}

steps:
- name: Checkout Source
uses: actions/checkout@v3

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

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

- name: Setup Acceptance Test Matrix
id: get-matrix
run: |
bundle exec matrix_from_metadata_v2 --exclude-platforms '["Ubuntu-22.04-arm", "RedHat-9-arm"]'

Acceptance:
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
needs:
- setup_matrix
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}

runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}

env:
PUPPET_GEM_VERSION: '~> 7.24'
FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main'

steps:
- name: Checkout Source
uses: actions/checkout@v3

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

- name: Print bundle environment
run: |
bundle env

- name: "Disable mysqld apparmor profile"
if: ${{matrix.platforms.provider == 'docker'}}
run: |
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/disable/usr.sbin.mysqld
sudo systemctl disable apparmor
sudo systemctl stop apparmor

- name: Provision test environment
run: |
bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
FILE='spec/fixtures/litmus_inventory.yaml'
sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true

- name: Install agent
run: |
bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'

- name: Install module
run: |
bundle exec rake 'litmus:install_module'

- name: Run acceptance tests
run: |
bundle exec rake 'litmus:acceptance:parallel'

- name: Remove test environment
if: ${{ always() }}
continue-on-error: true
run: |
bundle exec rake 'litmus:tear_down'
needs: Spec
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
secrets: "inherit"
with:
runs_on: ubuntu-20.04
kernel_modules: false
disable_apparmor: true
31 changes: 29 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
name: "Publish module"
run-name: >
${{ format('tag={0}', inputs.tag) }}
${{ format('release={0}', inputs.release) }}
${{ format('publish={0}', inputs.publish) }}
${{ format('edit={0}', inputs.edit) }}

on:
workflow_dispatch:

inputs:
tag:
description: "Leave blank to tag HEAD of branch, or existing tag to edit"
default: ''
type: string
release:
description: "Create a Github release"
type: boolean
default: true
publish:
description: "Publish to the Forge"
type: boolean
default: true
edit:
description: "Regenerate release notes and existing tag"
default: false
type: boolean

jobs:
release:
release:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main"
secrets: "inherit"
with:
tag: ${{ inputs.tag }}
release: ${{ inputs.release }}
publish: ${{ inputs.publish }}
edit: ${{ inputs.edit }}
4 changes: 3 additions & 1 deletion .github/workflows/release_prep.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: "Release Prep"
run-name: >
version=${{ inputs.version }}

on:
workflow_dispatch:
Expand All @@ -11,5 +13,5 @@ jobs:
release_prep:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main"
with:
version: "${{ github.event.inputs.version }}"
version: "${{ inputs.version }}"
secrets: "inherit"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@
.envrc
/inventory.yaml
/spec/fixtures/litmus_inventory.yaml
.resource_types
.modules
.task_cache.json
.plan_cache.json
.rerun.json
bolt-debug.log
Loading
Loading