forked from kubernetes/autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (65 loc) · 1.96 KB
/
pr.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
permissions:
contents: read
jobs:
changes:
permissions:
contents: read # for dorny/paths-filter to fetch a list of changed files
pull-requests: read # for dorny/paths-filter to read pull requests
outputs:
charts: ${{ steps.filter.outputs.charts }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- id: filter
uses: dorny/[email protected]
with:
filters: |
charts:
- 'charts/**/Chart.yaml'
- 'charts/**/*'
token: ${{ secrets.GITHUB_TOKEN }}
helm-lint-test:
if: ${{ needs.changes.outputs.charts == 'true' }}
name: Helm chart
needs:
- changes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Fetch history
run: git fetch --prune --unshallow
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (lint)
run: ct lint
# Only build a kind cluster if there are chart changes to test.
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- if: steps.list-changed.outputs.changed == 'true'
name: Create kind cluster
uses: helm/[email protected]
- if: steps.list-changed.outputs.changed == 'true'
name: Run chart-testing (install)
run: ct install
helm-docs-validate:
if: ${{ needs.changes.outputs.charts == 'true' }}
name: Helm Docs
needs:
- changes
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run helm-docs
uses: docker://jnorwood/helm-docs:v1.3.0
- name: Check for changes
run: git diff --quiet charts/*/README.md
name: Lint and Test Charts
on: pull_request