-
Notifications
You must be signed in to change notification settings - Fork 18
111 lines (103 loc) · 3.53 KB
/
pullrequest.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
name: Lint and Test Charts
on:
pull_request:
branches:
- main
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.2
- uses: actions/setup-python@v5
with:
python-version: '3.9'
check-latest: true
- name: Set up chart-testing
uses: helm/[email protected]
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
#https://github.com/helm/chart-testing/issues/192
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }} --validate-maintainers=false
changes:
if: ${{ github.actor != 'renovate[bot]' }}
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
charts: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
jupyter-pyspark:
- 'charts/jupyter-pyspark/**'
jupyter-python:
- 'charts/jupyter-python/**'
jupyter-python-gpu:
- 'charts/jupyter-python-gpu/**'
jupyter-pytorch:
- 'charts/jupyter-pytorch/**'
jupyter-pytorch-gpu:
- 'charts/jupyter-pytorch-gpu/**'
jupyter-r:
- 'charts/jupyter-r/**'
jupyter-tensorflow:
- 'charts/jupyter-tensorflow/**'
jupyter-tensorflow-gpu:
- 'charts/jupyter-tensorflow-gpu/**'
rstudio:
- 'charts/rstudio/**'
rstudio-gpu:
- 'charts/rstudio-gpu/**'
rstudio-sparkr:
- 'charts/rstudio-sparkr/**'
vscode-python:
- 'charts/vscode-python/**'
vscode-python-gpu:
- 'charts/vscode-python-gpu/**'
vscode-pytorch:
- 'charts/vscode-pytorch/**'
vscode-pytorch-gpu:
- 'charts/vscode-pytorch-gpu/**'
vscode-r-python-julia:
- 'charts/vscode-r-python-julia/**'
vscode-tensorflow:
- 'charts/vscode-tensorflow/**'
vscode-tensorflow-gpu:
- 'charts/vscode-tensorflow-gpu/**'
unittest:
needs: changes
if: ${{ needs.changes.outputs.charts != '[]' && needs.changes.outputs.charts != '' }}
strategy:
matrix:
# Parse JSON array containing names of all filters matching any of changed files
# e.g. ['package1', 'package2'] if both package folders contains changes
charts: ${{ fromJSON(needs.changes.outputs.charts) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: helm unit test
run: |
echo "Changed chart folders:"
echo "${{ matrix.charts }}"
helm plugin install https://github.com/helm-unittest/helm-unittest.git
helm dependency update charts/${{ matrix.charts }}
helm unittest charts/${{ matrix.charts }} -f ../../tests/*.yaml