-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (41 loc) · 1.36 KB
/
validate.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
name: Validate
on:
# Validate on push for Renovate auto merge without PR
push:
branches:
- 'main'
- 'renovate/**'
pull_request:
jobs:
validate:
runs-on: ubuntu-latest
# Exclude duplicate execution for PRs from renovate branches
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'renovate/')) }}
steps:
- uses: actions/checkout@v4
# https://stackoverflow.com/a/73596568
- name: Setup to skip ksops decryption
run: sudo ln -s /bin/true /usr/local/bin/ksops
- name: Cache CRDs
id: crd
uses: actions/cache@v4
with:
path: .crd
key: crd-${{ hashFiles('./setup-crd.sh') }}
- name: Prepare CRDs
if: steps.crd.outputs.cache-hit != 'true'
run: ./setup-crd.sh
- name: Install kubeconform
run: |
# renovate:github-url
wget https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz
tar -zxvf kubeconform-linux-amd64.tar.gz kubeconform
sudo install kubeconform /usr/local/bin && rm kubeconform kubeconform-linux-amd64.tar.gz
- name: Build
run: ./build.sh
- name: Validate
run: |
for file in .built/*.yaml; do
echo "Validating $file"
<"$file" ./check.sh
done