-
Notifications
You must be signed in to change notification settings - Fork 738
136 lines (112 loc) · 4.6 KB
/
helm.yaml
File metadata and controls
136 lines (112 loc) · 4.6 KB
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
134
135
136
name: Helm
on:
push:
branches:
- master
- release-*
pull_request:
branches:
- master
- release-*
env:
CHART_DIR: helm-chart
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.actor }}
cancel-in-progress: true
jobs:
lint-test:
name: Lint and Test
runs-on: ubuntu-24.04
strategy:
matrix:
chart:
- kuberay-operator
- kuberay-apiserver
- ray-cluster
steps:
- name: Determine branch name
id: get_branch
run: |
BRANCH=""
if [ "${{ github.event_name }}" == "push" ]; then
BRANCH=${{ github.ref_name }}
elif [ "${{ github.event_name }}" == "pull_request" ]; then
BRANCH=${{ github.base_ref }}
fi
echo "BRANCH=$BRANCH" >> "$GITHUB_OUTPUT"
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4.3.0
with:
version: v3.17.3
- uses: actions/setup-python@v5.3.0
with:
python-version: 3.13
- name: Install Helm unittest plugin
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git --version 0.8.1
- name: Run Helm unittest
run: helm unittest ${{ env.CHART_DIR }}/${{ matrix.chart }} --file "tests/**/*_test.yaml" --strict --debug
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
- name: Run chart-testing (list-changed)
id: list-changed
env:
BRANCH: ${{ steps.get_branch.outputs.BRANCH }}
run: |
changed=$(ct list-changed --target-branch $BRANCH --chart-dirs ${{ env.CHART_DIR }} | grep ${{ matrix.chart }} || true)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
env:
BRANCH: ${{ steps.get_branch.outputs.BRANCH }}
run: |
# Run 'helm lint', version checking, YAML schema validation on 'Chart.yaml',
# YAML linting on 'Chart.yaml' and 'values.yaml', and maintainer.
# [Doc]: https://github.com/helm/chart-testing/blob/main/doc/ct_lint.md
ct lint --charts ${{ env.CHART_DIR }}/${{ matrix.chart }} --validate-maintainers=false
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.12.0
with:
cluster_name: kind
- name: Build Docker image (kuberay-operator)
if: steps.list-changed.outputs.changed == 'true' && matrix.chart == 'kuberay-operator'
run: |
cd ray-operator && make docker-image -e IMG=kuberay/operator:local
- name: Build Docker image (kuberay-apiserver)
if: steps.list-changed.outputs.changed == 'true' && matrix.chart == 'kuberay-apiserver'
run: |
cd apiserver && make docker-image -e IMG=kuberay/apiserver:local
- name: Build Docker image (security-proxy)
if: steps.list-changed.outputs.changed == 'true' && matrix.chart == 'kuberay-apiserver'
run: |
cd experimental && make docker-image -e IMG=kuberay/security-proxy:local
- name: Load image to kind cluster (kuberay-operator)
if: steps.list-changed.outputs.changed == 'true' && matrix.chart == 'kuberay-operator'
run: |
kind load docker-image kuberay/operator:local
- name: Load image to kind cluster (kuberay-apiserver)
if: steps.list-changed.outputs.changed == 'true' && matrix.chart == 'kuberay-apiserver'
run: |
kind load docker-image kuberay/apiserver:local
- name: Load image to kind cluster (security-proxy)
if: steps.list-changed.outputs.changed == 'true' && matrix.chart == 'kuberay-apiserver'
run: |
kind load docker-image kuberay/security-proxy:local
- name: Install Custom Resource Definitions to kind cluster
if: steps.list-changed.outputs.changed == 'true' && matrix.chart == 'ray-cluster'
working-directory: helm-chart/kuberay-operator
run: kubectl create -f crds
- name: Run chart-testing
if: steps.list-changed.outputs.changed == 'true'
env:
BRANCH: ${{ steps.get_branch.outputs.BRANCH }}
run: |
# Run 'helm install', 'helm test', and optionally 'helm upgrade' on specified charts.
# [Doc]: https://github.com/helm/chart-testing/blob/main/doc/ct_install.md
ct install --charts ${{ env.CHART_DIR}}/${{ matrix.chart }}