Skip to content

Commit

Permalink
Adds basic workflow for pdk based modules
Browse files Browse the repository at this point in the history
  • Loading branch information
logicminds committed Apr 22, 2022
1 parent 238b8d0 commit 0872d40
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pdk-basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PDK basic

on:
workflow_call:
inputs:
container_image:
description: Image to use when running tests
default: 'puppet/puppet-dev-tools:2022-04-21-e44b72b'
required: false
type: string

jobs:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
puppet-version: [7]
container: ${{ inputs.container_image }}

steps:
- uses: actions/checkout@v2
- name: action-pdk-validate-puppet-${{ matrix.puppet-version }}
run: pdk validate --puppet-version=${{ matrix.puppet-version }}

unit-puppet:
runs-on: ubuntu-latest
strategy:
matrix:
puppet-version: [5, 6, 7]
container: ${{ inputs.container_image }}
needs: validate
steps:
- uses: actions/checkout@v2

- name: action-pdk-test-unit-puppet-${{ matrix.puppet-version }}
run: pdk test unit --puppet-version=${{ matrix.puppet-version }}
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,31 @@ jobs:
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
working-directory: ./site/profiles
```

## Cloning private repos
If your CI pipline will clone private repos via the .fixtures.yml or Puppetfile
you will need to supply a ssh private key for the runner to use during the job.

That ssh private key can be a machine user's ssh key, or github deploy key. As long
as the key has access to the repos it will need to clone.

You will need to create a github secret for the private key named `PRIVATE_SSH_KEY`

An example CI workflow is below for this kind of setup.

For reference: https://stackoverflow.com/questions/57612428/cloning-private-github-repository-within-organisation-in-actions


```yaml
name: CI
on: pull_request
jobs:
puppet:
- name: Setup deploy key
run: eval `ssh-agent -s` && ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
- name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/pdk-basic.yml@master

```

0 comments on commit 0872d40

Please sign in to comment.