-
Notifications
You must be signed in to change notification settings - Fork 410
155 lines (132 loc) · 4.17 KB
/
consistency-check.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: operator-consistency-check
on:
push:
branches:
- master
pull_request:
branches: [ master ]
jobs:
# Check consistency between types.go and generated API.
ray-operator-verify-codegen:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
# Use the same go version with build job
go-version: v1.22
- name: Check golang version
working-directory: ./ray-operator
run: go version
- name: Verify Codegen
working-directory: ./ray-operator
run: ./hack/verify-codegen.sh
- name: Verify Generated Files
working-directory: ./ray-operator
run: ./hack/verify-generated-files.sh
# Check consistency between types.go and generated API reference.
ray-operator-verify-api-docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
# Use the same go version with build job
go-version: v1.22
- name: Check golang version
working-directory: ./ray-operator
run: go version
- name: Verify API reference
working-directory: ./ray-operator
run: ./hack/verify-api-docs.sh
# 1. Check consistency between types.go and CRD YAML files.
# 2. Check consistency between kubebuilder markers and RBAC.
ray-operator-verify-crd-rbac:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
# Use the same go version with build job
go-version: v1.22
- name: Update CRD/RBAC YAML files
working-directory: ./ray-operator
run: make manifests
- name: Verify Changed files
id: verify-changed-files
uses: tj-actions/verify-changed-files@v17
with:
files: |
./config/bases/*.yaml
./config/rbac/*.yaml
- name: Check changed files
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: actions/github-script@v3
with:
script: |
core.setFailed('Please run \"make manifests\" to synchronize CRD and RBAC!')
# Check consistency between CRD YAML files in ray-operator/config/crd/bases
# and in helm-chart/kuberay-operator/crds
helm-chart-verify-crd:
needs: ray-operator-verify-crd-rbac
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Update CRD YAML files
run: |
rm -r helm-chart/kuberay-operator/crds/
cp -r ray-operator/config/crd/bases/ helm-chart/kuberay-operator/crds/
- name: Verify Changed files
id: verify-changed-files
uses: tj-actions/verify-changed-files@v17
with:
files: |
./helm-chart/kuberay-operator/crds/*.yaml
- name: Check changed files
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: actions/github-script@v3
with:
script: |
core.setFailed('Please run \"make sync\" to synchronize CRDs!')
# Check consistency between RBAC YAML files in ray-operator/config/rbac/
# and in helm-chart/kuberay-operator/templates
helm-chart-verify-rbac:
needs: ray-operator-verify-crd-rbac
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: v3.9.4
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
pip3 install -r scripts/requirements.txt
- name: Check rbac consistency
run: |
python3 scripts/rbac-check.py
- name: Check rbac configuration
run: |
cd helm-chart/script/
pytest -s