Skip to content

Commit 429089a

Browse files
committed
Adds basic workflow for pdk based modules
1 parent 238b8d0 commit 429089a

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.github/workflows/pdk-basic.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: PDK basic
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
container_image:
7+
description: Image to use when running tests
8+
default: 'puppet/puppet-dev-tools:2022-04-21-e44b72b'
9+
required: false
10+
type: string
11+
12+
jobs:
13+
validate:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
puppet-version: [7]
18+
container: ${{ inputs.container_image }}
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: action-pdk-validate-puppet-${{ matrix.puppet-version }}
23+
run: pdk validate --puppet-version=${{ matrix.puppet-version }}
24+
25+
unit-puppet:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
puppet-version: [5, 6, 7]
30+
container: ${{ inputs.container_image }}
31+
needs: validate
32+
steps:
33+
- uses: actions/checkout@v2
34+
35+
- name: action-pdk-test-unit-puppet-${{ matrix.puppet-version }}
36+
run: pdk test unit --puppet-version=${{ matrix.puppet-version }}

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,31 @@ jobs:
214214
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
215215
working-directory: ./site/profiles
216216
```
217+
218+
## Cloning private repos
219+
If your CI pipline will clone private repos via the .fixtures.yml or Puppetfile
220+
you will need to supply a ssh private key for the runner to use during the job.
221+
222+
That ssh private key can be a machine user's ssh key, or github deploy key. As long
223+
as the key has access to the repos it will need to clone.
224+
225+
You will need to create a github secret for the private key named `PRIVATE_SSH_KEY`
226+
227+
An example CI workflow is below for this kind of setup.
228+
229+
For reference: https://stackoverflow.com/questions/57612428/cloning-private-github-repository-within-organisation-in-actions
230+
231+
232+
```yaml
233+
name: CI
234+
235+
on: pull_request
236+
237+
jobs:
238+
puppet:
239+
name: Setup deploy key
240+
run: eval `ssh-agent -s` && ssh-add - <<< '${{ secrets.PRIVATE_SSH_KEY }}'
241+
name: Puppet
242+
uses: voxpupuli/gha-puppet/.github/workflows/pdk-basic.yml@master
243+
244+
```

0 commit comments

Comments
 (0)