Initial attempt at helm chart #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Helm Chart Tests | |
on: | |
push: | |
branches: [ main, develop, feat/* ] | |
paths: | |
- 'helm-chart/**' | |
- '.github/workflows/helm-chart-test.yml' | |
pull_request: | |
branches: [ main, develop ] | |
paths: | |
- 'helm-chart/**' | |
- '.github/workflows/helm-chart-test.yml' | |
env: | |
HELM_VERSION: v3.13.0 | |
KUBECTL_VERSION: v1.28.0 | |
KIND_VERSION: v0.20.0 | |
jobs: | |
lint: | |
name: Lint Helm Chart | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Setup Helm repositories | |
uses: ./.github/actions/setup-helm-repos | |
- name: Lint Helm chart | |
run: | | |
cd helm-chart/stac-fastapi | |
helm dependency update | |
helm lint . | |
test-matrix: | |
name: Test Chart | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
matrix: | |
backend: [elasticsearch, opensearch] | |
kubernetes-version: [v1.27.3, v1.28.0] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Set up kubectl | |
uses: azure/setup-kubectl@v3 | |
with: | |
version: ${{ env.KUBECTL_VERSION }} | |
- name: Set up Kind | |
uses: helm/[email protected] | |
with: | |
version: ${{ env.KIND_VERSION }} | |
node_image: kindest/node:${{ matrix.kubernetes-version }} | |
cluster_name: stac-fastapi-test | |
- name: Setup Helm repositories | |
uses: ./.github/actions/setup-helm-repos | |
- name: Run matrix tests | |
env: | |
BACKEND: ${{ matrix.backend }} | |
MATRIX_MODE: true | |
run: | | |
chmod +x ./helm-chart/test-chart.sh | |
./helm-chart/test-chart.sh -m -b ${{ matrix.backend }} ci | |
- name: Upload test reports | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test-report-${{ matrix.backend }}-k8s-${{ matrix.kubernetes-version }} | |
path: test-report-*.json | |
integration-test: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
needs: test-matrix | |
if: github.event_name == 'pull_request' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Set up kubectl | |
uses: azure/setup-kubectl@v3 | |
with: | |
version: ${{ env.KUBECTL_VERSION }} | |
- name: Set up Kind | |
uses: helm/[email protected] | |
with: | |
version: ${{ env.KIND_VERSION }} | |
cluster_name: stac-fastapi-integration | |
- name: Setup Helm repositories | |
uses: ./.github/actions/setup-helm-repos | |
- name: Run full integration tests | |
run: | | |
chmod +x ./helm-chart/test-chart.sh | |
./helm-chart/test-chart.sh test-all | |
- name: Test upgrade scenarios | |
run: | | |
# Test elasticsearch to opensearch migration scenario | |
./helm-chart/test-chart.sh -b elasticsearch install | |
./helm-chart/test-chart.sh validate | |
./helm-chart/test-chart.sh cleanup | |
# Test opensearch deployment | |
./helm-chart/test-chart.sh -b opensearch install | |
./helm-chart/test-chart.sh validate | |
./helm-chart/test-chart.sh cleanup | |
security-scan: | |
name: Security Scan | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Setup Helm repositories | |
uses: ./.github/actions/setup-helm-repos | |
- name: Run Checkov security scan | |
uses: bridgecrewio/checkov-action@master | |
with: | |
directory: helm-chart/ | |
framework: kubernetes | |
output_format: sarif | |
output_file_path: reports/results.sarif | |
- name: Upload Checkov results | |
if: always() | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: reports/results.sarif | |
chart-testing: | |
name: Chart Testing (ct) | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: ${{ env.HELM_VERSION }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Set up chart-testing | |
uses: helm/[email protected] | |
- name: Setup Helm repositories | |
uses: ./.github/actions/setup-helm-repos | |
- name: Run chart-testing (list) | |
run: ct list --config .github/ct.yaml | |
- name: Run chart-testing (lint) | |
run: ct lint --config .github/ct.yaml | |
- name: Set up Kind cluster | |
uses: helm/[email protected] | |
with: | |
version: ${{ env.KIND_VERSION }} | |
- name: Run chart-testing (install) | |
run: ct install --config .github/ct.yaml |