-
Notifications
You must be signed in to change notification settings - Fork 18
84 lines (79 loc) · 2.75 KB
/
acceptance.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
name: Test Module
run-name: >
${{ inputs.image && format('image={0}', inputs.image) || '' }}
${{ inputs.repo && format('repo={0}', inputs.repo) || '' }}
${{ inputs.ref && format('ref={0}', inputs.ref) || '' }}
on ${{ inputs.runs-on }}
on:
workflow_dispatch:
inputs:
image:
required: true
description: Litmus image:tag
type: string
default: "debian:10"
repo:
description: repo of module to acceptance test
type: string
default: "puppetlabs/puppetlabs-stdlib"
ref:
description: module git ref (optional)
type: string
provision_task:
description: provision task
type: choice
default: docker
options:
- docker
- docker_exp
latest_modules:
description: patch module fixtures with latest Puppet Litmus required modules
type: boolean
default: true
provision_module:
description: provision module overrides (JSON Hash)
type: string
puppet_agent_module:
description: puppet_agent module overrides (JSON Hash)
type: string
runs-on:
description: run the workflow on
default: ubuntu-20.04
type: choice
options:
- ubuntu-latest
- ubuntu-22.04
- ubuntu-20.04
env:
REGISTRY: ${{ vars.DOCKER_REGISTRY != '' && vars.DOCKER_REGISTRY || 'ghcr.io' }}
REPOSITORY: ${{ vars.DOCKER_REPOSITORY != '' && vars.DOCKER_REPOSITORY || github.repository }}
BOLT_GEM: 1
jobs:
acceptance:
runs-on: ${{ inputs.runs-on }}
steps:
- name: Setup Vars
id: vars
run: |
if [[ "${{ inputs.latest_modules }}" != "false" ]] ; then
echo 'provision_module="https://github.com/puppetlabs/provision.git"' >> "${GITHUB_OUTPUT}"
echo 'puppet_agent_module="https://github.com/puppetlabs/puppetlabs-puppet_agent.git"' >> "${GITHUB_OUTPUT}"
fi
if [[ -n "${{ inputs.provision_module }}" ]] ; then
echo 'provision_module=${{ inputs.provision_module }}' >> "${GITHUB_OUTPUT}"
fi
if [[ -n "${{ inputs.puppet_agent_module }}" ]] ; then
echo 'puppet_agent_module=${{ inputs.puppet_agent_module }}' >> "${GITHUB_OUTPUT}"
fi
- name: Checkout
uses: actions/checkout@v4
- name: Test
uses: ./.github/actions/acceptance-test
with:
docker_image: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/${{ inputs.image }}
repo: ${{ inputs.repo }}
ref: ${{ inputs.ref }}
provision_task: ${{ inputs.provision_task }}
provision_module: ${{ steps.vars.outputs.provision_module }}
puppet_agent_module: ${{ steps.vars.outputs.puppet_agent_module }}