Skip to content

Commit 6b865bb

Browse files
committed
Clean up some auto generated content
1 parent 55eac51 commit 6b865bb

File tree

14 files changed

+1047
-949
lines changed

14 files changed

+1047
-949
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: 'Setup Helm Repositories'
2+
description: 'Add required Helm repositories for STAC FastAPI'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Add Helm repositories
8+
shell: bash
9+
run: |
10+
helm repo add elasticsearch https://helm.elastic.co
11+
helm repo add opensearch https://opensearch-project.github.io/helm-charts/
12+
helm repo update

.github/ct-config.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/ct-lint.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Chart Testing Lint Configuration
2+
# Additional linting rules for chart-testing
3+
4+
rules:
5+
braces:
6+
min-spaces-inside: 0
7+
max-spaces-inside: 1
8+
brackets:
9+
min-spaces-inside: 0
10+
max-spaces-inside: 0
11+
colons:
12+
max-spaces-before: 0
13+
max-spaces-after: 1
14+
commas:
15+
max-spaces-before: 0
16+
min-spaces-after: 1
17+
max-spaces-after: 1
18+
comments:
19+
min-spaces-from-content: 1
20+
comments-indentation: disable
21+
document-end: disable
22+
document-start: disable
23+
empty-lines:
24+
max: 2
25+
max-start: 0
26+
max-end: 1
27+
hyphens:
28+
max-spaces-after: 1
29+
indentation:
30+
spaces: 2
31+
indent-sequences: true
32+
key-duplicates: enable
33+
line-length:
34+
max: 120
35+
allow-non-breakable-words: true
36+
allow-non-breakable-inline-mappings: true
37+
new-line-at-end-of-file: enable
38+
octal-values: disable
39+
quoted-strings: disable
40+
trailing-spaces: enable
41+
truthy:
42+
allowed-values: ['true', 'false']
43+
check-keys: false

.github/ct.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Chart Testing Configuration
2+
# This configuration is used by the chart-testing (ct) tool
3+
4+
# Chart directories relative to repository root
5+
chart-dirs:
6+
- helm-chart
7+
8+
# Target branch for pull request testing
9+
target-branch: main
10+
11+
# Chart repositories to add
12+
chart-repos:
13+
- name: elasticsearch
14+
url: https://helm.elastic.co
15+
- name: opensearch
16+
url: https://opensearch-project.github.io/helm-charts/
17+
18+
# Helm version to use
19+
helm-version: v3.13.0
20+
21+
# Additional configurations
22+
validate-chart-schema: true
23+
validate-maintainers: false
24+
check-version-increment: true
25+
process-skipped-charts: false
26+
27+
# Test configuration
28+
upgrade: false
29+
skip-missing-values: true
30+
31+
# Linting configuration
32+
lint-conf: .github/ct-lint.yaml
33+
34+
# Additional Helm lint settings
35+
helm-lint-extra-args: --set app.image.tag=latest
Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
name: Helm Chart Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop, feat/* ]
6+
paths:
7+
- 'helm-chart/**'
8+
- '.github/workflows/helm-chart-test.yml'
9+
pull_request:
10+
branches: [ main, develop ]
11+
paths:
12+
- 'helm-chart/**'
13+
- '.github/workflows/helm-chart-test.yml'
14+
15+
env:
16+
HELM_VERSION: v3.13.0
17+
KUBECTL_VERSION: v1.28.0
18+
KIND_VERSION: v0.20.0
19+
20+
jobs:
21+
lint:
22+
name: Lint Helm Chart
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Helm
29+
uses: azure/setup-helm@v3
30+
with:
31+
version: ${{ env.HELM_VERSION }}
32+
33+
- name: Setup Helm repositories
34+
uses: ./.github/actions/setup-helm-repos
35+
36+
- name: Lint Helm chart
37+
run: |
38+
cd helm-chart/stac-fastapi
39+
helm dependency update
40+
helm lint .
41+
42+
test-matrix:
43+
name: Test Chart
44+
runs-on: ubuntu-latest
45+
needs: lint
46+
strategy:
47+
matrix:
48+
backend: [elasticsearch, opensearch]
49+
kubernetes-version: [v1.27.3, v1.28.0]
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
54+
- name: Set up Helm
55+
uses: azure/setup-helm@v3
56+
with:
57+
version: ${{ env.HELM_VERSION }}
58+
59+
- name: Set up kubectl
60+
uses: azure/setup-kubectl@v3
61+
with:
62+
version: ${{ env.KUBECTL_VERSION }}
63+
64+
- name: Set up Kind
65+
uses: helm/[email protected]
66+
with:
67+
version: ${{ env.KIND_VERSION }}
68+
node_image: kindest/node:${{ matrix.kubernetes-version }}
69+
cluster_name: stac-fastapi-test
70+
71+
- name: Setup Helm repositories
72+
uses: ./.github/actions/setup-helm-repos
73+
74+
- name: Run matrix tests
75+
env:
76+
BACKEND: ${{ matrix.backend }}
77+
MATRIX_MODE: true
78+
run: |
79+
chmod +x ./helm-chart/test-chart.sh
80+
./helm-chart/test-chart.sh -m -b ${{ matrix.backend }} ci
81+
82+
- name: Upload test reports
83+
if: always()
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: test-report-${{ matrix.backend }}-k8s-${{ matrix.kubernetes-version }}
87+
path: test-report-*.json
88+
89+
integration-test:
90+
name: Integration Tests
91+
runs-on: ubuntu-latest
92+
needs: test-matrix
93+
if: github.event_name == 'pull_request'
94+
steps:
95+
- name: Checkout
96+
uses: actions/checkout@v4
97+
98+
- name: Set up Helm
99+
uses: azure/setup-helm@v3
100+
with:
101+
version: ${{ env.HELM_VERSION }}
102+
103+
- name: Set up kubectl
104+
uses: azure/setup-kubectl@v3
105+
with:
106+
version: ${{ env.KUBECTL_VERSION }}
107+
108+
- name: Set up Kind
109+
uses: helm/[email protected]
110+
with:
111+
version: ${{ env.KIND_VERSION }}
112+
cluster_name: stac-fastapi-integration
113+
114+
- name: Setup Helm repositories
115+
uses: ./.github/actions/setup-helm-repos
116+
117+
- name: Run full integration tests
118+
run: |
119+
chmod +x ./helm-chart/test-chart.sh
120+
./helm-chart/test-chart.sh test-all
121+
122+
- name: Test upgrade scenarios
123+
run: |
124+
# Test elasticsearch to opensearch migration scenario
125+
./helm-chart/test-chart.sh -b elasticsearch install
126+
./helm-chart/test-chart.sh validate
127+
./helm-chart/test-chart.sh cleanup
128+
129+
# Test opensearch deployment
130+
./helm-chart/test-chart.sh -b opensearch install
131+
./helm-chart/test-chart.sh validate
132+
./helm-chart/test-chart.sh cleanup
133+
134+
security-scan:
135+
name: Security Scan
136+
runs-on: ubuntu-latest
137+
needs: lint
138+
steps:
139+
- name: Checkout
140+
uses: actions/checkout@v4
141+
142+
- name: Set up Helm
143+
uses: azure/setup-helm@v3
144+
with:
145+
version: ${{ env.HELM_VERSION }}
146+
147+
- name: Setup Helm repositories
148+
uses: ./.github/actions/setup-helm-repos
149+
150+
- name: Run Checkov security scan
151+
uses: bridgecrewio/checkov-action@master
152+
with:
153+
directory: helm-chart/
154+
framework: kubernetes
155+
output_format: sarif
156+
output_file_path: reports/results.sarif
157+
158+
- name: Upload Checkov results
159+
if: always()
160+
uses: github/codeql-action/upload-sarif@v2
161+
with:
162+
sarif_file: reports/results.sarif
163+
164+
chart-testing:
165+
name: Chart Testing (ct)
166+
runs-on: ubuntu-latest
167+
needs: lint
168+
steps:
169+
- name: Checkout
170+
uses: actions/checkout@v4
171+
with:
172+
fetch-depth: 0
173+
174+
- name: Set up Helm
175+
uses: azure/setup-helm@v3
176+
with:
177+
version: ${{ env.HELM_VERSION }}
178+
179+
- name: Set up Python
180+
uses: actions/setup-python@v4
181+
with:
182+
python-version: 3.x
183+
184+
- name: Set up chart-testing
185+
uses: helm/[email protected]
186+
187+
- name: Setup Helm repositories
188+
uses: ./.github/actions/setup-helm-repos
189+
190+
- name: Run chart-testing (list)
191+
run: ct list --config .github/ct.yaml
192+
193+
- name: Run chart-testing (lint)
194+
run: ct lint --config .github/ct.yaml
195+
196+
- name: Set up Kind cluster
197+
uses: helm/[email protected]
198+
with:
199+
version: ${{ env.KIND_VERSION }}
200+
201+
- name: Run chart-testing (install)
202+
run: ct install --config .github/ct.yaml

0 commit comments

Comments
 (0)