Use pdk validate
in CI templates (leveraging PDK Docker container)
#1069
Unanswered
sanfrancrisko
asked this question in
Feature Request
Replies: 1 comment 3 replies
-
For what it's worth, my team is now using a package based process to do testing in GitHub Actions. A sample of the config we are including in our modules can be found at https://github.com/ploperations/repo_standards/blob/main/templates/ci.yml and is reproduced below for reference. name: CI
on:
- pull_request
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
puppet_versions:
- '6'
- '7'
name: Puppet ${{ matrix.puppet_versions }}
steps:
- uses: actions/checkout@v1
- name: Install the Puppet PDK
run: |
CODENAME=$(grep UBUNTU_CODENAME /etc/os-release | cut -d '=' -f2)
wget https://apt.puppet.com/puppet-tools-release-$CODENAME.deb
sudo dpkg -i puppet-tools-release-$CODENAME.deb
sudo apt-get update
sudo apt-get install pdk
- name: Syntax validation
run: pdk validate --puppet-version ${{ matrix.puppet_versions }}
- name: Unit tests
run: pdk test unit --puppet-version ${{ matrix.puppet_versions }} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It has been noted (see #673) that there is inconsistency in the validation performed when running
pdk validate
and CI config templates defined in pdk-templates that execute validation tasks directly (such asrake lint
).There has also been discussion in PDK-709 about using
pdk validate
in our CI config templates, rather than having a completely separate experience.The path of least resistance to implementing this is to leverage the PDK Docker container, which would bypass package installs on various platforms. It has been noted, however, that the size of the container has created an unacceptable performance hit in some use cases.
There is some preliminary investigative work being undertaken to break up the PDK components and generate smaller artefacts for each use case:
For the use case of
pdk validate
in CI runs, it would be good to leverage the Docker container and start enhancing thevalidate
tasks to incorporate some of the enhancements or address some of the inconsistencies brought up in:pdk validate
andrake lint
#673Beta Was this translation helpful? Give feedback.
All reactions