-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
133 lines (122 loc) · 4.69 KB
/
action.yaml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: "Lint Charts"
description: "Setup and lint the helm charts"
inputs:
aws-access-key-id:
description: "AWS key for helm charts"
required: true
aws-region:
description: "The AWS region where there S3 bucket is created"
required: true
aws-secret-access-key:
description: "AWS secret for helm charts"
required: true
chart-directory:
description: "Path to the charts"
required: true
default-branch:
description: "The default branch. master|main"
required: true
deployment-name:
description: "The name of the helm deployment"
required: true
skip-aws-setup:
description: "Skip the AWS setup process if it has been run in the same job already"
required: false
default: "false"
skip-helm-setup:
description: "Skip the helm setup process if it has been run in the same job already"
required: false
default: "false"
skip-python-setup:
description: "Skip the Python setup process if it has been run in the same job already"
required: false
default: "false"
test-local:
description: "Test the templating of local values"
required: false
default: "true"
test-production:
description: "Test the templating of production values"
required: false
default: "true"
test-staging:
description: "Test the templating of staging values"
required: false
default: "true"
skip-version-bump-check:
description: "Skip checking for a version bump"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: Setup Python
if: ${{ inputs.skip-python-setup == 'false' }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Setup Helm
if: ${{ inputs.skip-helm-setup == 'false' }}
uses: azure/setup-helm@v3
with:
version: v3.11.1
- name: Setup Helm S3 Plugin
if: ${{ inputs.skip-helm-setup == 'false' }}
shell: bash
run: |
helm plugin install https://github.com/hypnoglow/helm-s3.git --version 0.14.0
- name: Setup Chart Testing Tool
if: ${{ inputs.skip-helm-setup == 'false' }}
uses: helm/[email protected]
- name: Configure AWS Credentials
if: ${{ inputs.skip-aws-setup == 'false' }}
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
- name: Run Chart Changes Test
id: list-changed
shell: bash
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
env:
CT_CHART_DIRS: charts
CT_VALIDATE_MAINTAINERS: false
CT_TARGET_BRANCH: ${{ inputs.default-branch }}
- name: Run Production Chart Linting Test (skip version bump)
shell: bash
if: ${{ inputs.skip-version-bump-check == 'true' }}
run: ct lint --charts ${{ inputs.chart-directory }} --check-version-increment false --helm-lint-extra-args '-f ${{ inputs.chart-directory }}/values.yaml -f ${{ inputs.chart-directory }}/values-production.yaml'
env:
CT_VALIDATE_MAINTAINERS: false
CT_CHECK_VERSION_INCREMENT: false
CT_TARGET_BRANCH: ${{ inputs.default-branch }}
- name: Run Production Chart Linting Test
shell: bash
if: ${{ inputs.skip-version-bump-check == 'false' }}
run: ct lint --charts ${{ inputs.chart-directory }} --helm-lint-extra-args '-f ${{ inputs.chart-directory }}/values.yaml -f ${{ inputs.chart-directory }}/values-production.yaml'
env:
CT_VALIDATE_MAINTAINERS: false
CT_TARGET_BRANCH: ${{ inputs.default-branch }}
- name: Remove Chart.lock
shell: bash
run: rm -f ${{ inputs.chart-directory }}/Chart.lock
- name: Run Staging Chart Linting Test (skip version bump)
shell: bash
if: ${{ inputs.skip-version-bump-check == 'true' }}
run: ct lint --charts ${{ inputs.chart-directory }} --check-version-increment false --helm-lint-extra-args '-f ${{ inputs.chart-directory }}/values.yaml -f ${{ inputs.chart-directory }}/values-staging.yaml'
env:
CT_VALIDATE_MAINTAINERS: false
CT_CHECK_VERSION_INCREMENT: false
CT_TARGET_BRANCH: ${{ inputs.default-branch }}
- name: Run Staging Chart Linting Test
shell: bash
if: ${{ inputs.skip-version-bump-check == 'false' }}
run: ct lint --charts ${{ inputs.chart-directory }} --helm-lint-extra-args '-f ${{ inputs.chart-directory }}/values.yaml -f ${{ inputs.chart-directory }}/values-staging.yaml'
env:
CT_VALIDATE_MAINTAINERS: false
CT_TARGET_BRANCH: ${{ inputs.default-branch }}