-
Notifications
You must be signed in to change notification settings - Fork 1
142 lines (121 loc) · 4.02 KB
/
dev_validation.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
# Copyright 2024 Flant JSC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Validations
env:
GO_VERSION: "1.22.7"
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]
concurrency:
group: "${{ github.workflow }}-${{ github.event.number || github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
paths_filter:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'validation/skip/helm_templates') }}
runs-on: ubuntu-latest
name: Filter changed paths
outputs:
helm_templates: ${{ steps.paths_filter.outputs.helm_templates }}
steps:
# For pull requests it's not necessary to checkout the code, this action uses Github API.
- uses: dorny/paths-filter@v3
id: paths_filter
with:
filters: |
helm_templates:
- 'crds/**'
- 'charts/**'
- 'tools/kubeconform/**'
- 'templates/**'
- .helmignore
- Chart.yaml
- Taskfile.yaml
no_cyrillic:
if: "!contains(github.event.pull_request.labels.*.name, 'validation/skip/no_cyrillic')"
runs-on: ubuntu-latest
name: Validation no-cyrillic
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.37.2
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Run validation "No cyrillic"
run: |
task validation:no-cyrillic
doc_changes:
if: "!contains(github.event.pull_request.labels.*.name, 'validation/skip/doc_changes')"
runs-on: ubuntu-latest
name: Validation doc-changes
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.37.2
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Run validation "Doc changes"
run: |
task validation:doc-changes
copyright:
if: "!contains(github.event.pull_request.labels.*.name, 'validation/skip/copyright')"
runs-on: ubuntu-latest
name: Validation copyright
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.37.2
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Run validation "Copyright"
run: |
task validation:copyright
# Run helm templates validation on changes in related files and without the skip labels.
helm_templates:
needs: paths_filter
if: ${{ needs.paths_filter.outputs.helm_templates == 'true' && !contains(github.event.pull_request.labels.*.name, 'validation/skip/helm_templates') }}
runs-on: ubuntu-latest
name: Validate helm templates with OpenAPI schemas
steps:
- name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.37.2
- uses: actions/checkout@v4
- name: Run validation "Helm templates"
run: |
task validation:helm-templates