-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (92 loc) · 2.74 KB
/
ci.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
name: CI
on:
push:
permissions:
id-token: write
contents: read
pull-requests: read
jobs:
filter:
runs-on: ubuntu-latest
outputs:
kube: ${{ steps.path-filter.outputs.kube }}
gcp: ${{ steps.path-filter.outputs.gcp }}
aws: ${{ steps.path-filter.outputs.aws }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: path-filter
with:
filters: |
kube:
- "kubernetes/**"
- ".github/workflows/ci.yaml"
- ".github/actions/**"
gcp:
- "gcp/**"
- ".github/workflows/ci.yaml"
- ".github/actions/**"
aws:
- "aws/**"
- ".github/workflows/ci.yaml"
- ".github/actions/**"
kubeconform:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.kube == 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: /tmp/pkustomize/cache
key: pkustomize-${{ hashFiles('kubernetes/scripts/pkustomize/main.go') }}
- uses: ./.github/actions/setup-aqua
- run: cd kubernetes && bash scripts/kubeconform.sh
kube-yamlfmt:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.kube == 'true'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-aqua
- name: Yamlfmt
run: cd kubernetes && yamlfmt -lint
kube-cluster-tls:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.kube == 'true'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-aqua
- name: Ytt
run: cd kubernetes && bash scripts/cluster-tls.sh
- run: if [ -n "$(git status --porcelain)" ]; then git diff; exit 1; fi
kube-ytt:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.kube == 'true'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-aqua
- name: Ytt
run: cd kubernetes && bash scripts/ytt.sh
- run: if [ -n "$(git status --porcelain)" ]; then git diff; exit 1; fi
kube-flux:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.kube == 'true'
steps:
- uses: actions/checkout@v4
- run: cd kubernetes && bash scripts/flux-kustomize.sh
- run: if [ -n "$(git status --porcelain)" ]; then git diff; exit 1; fi
tf-format:
runs-on: ubuntu-latest
needs: filter
if: needs.filter.outputs.aws == 'true' || needs.filter.outputs.gcp == 'true'
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.9.5
- name: Terraform fmt
run: terraform fmt -check -recursive