Skip to content

Commit

Permalink
Inital update.
Browse files Browse the repository at this point in the history
  • Loading branch information
antejavor committed Apr 23, 2024
1 parent 7ae1fa1 commit 71f4210
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 52 deletions.
80 changes: 40 additions & 40 deletions .github/workflows/chart-validation.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
name: Chart Validation
on:
push:
branches:
- main
pull_request:
branches:
- main
# name: Chart Validation
# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main

jobs:
validate:
runs-on: ubuntu-latest
# jobs:
# validate:
# runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
# steps:
# - name: Checkout code
# uses: actions/checkout@v2

- name: Install Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
# Validate that the Helm charts adhere to the proper structure and contain the necessary files.
# This includes checking for the presence of Chart.yaml, values.yaml, and other required files.
- name: Validate Helm Charts
run: |
helm repo add stable https://charts.helm.sh/stable
helm repo update
helm lint charts/memgraph/
# The Helm templates are rendered using the helm template command,
# and the output is stored in a file named rendered-templates.yaml.
# This step ensures that there are no syntax or rendering errors in the templates.
- name: Render Helm Templates
run: |
helm template charts/memgraph/ > rendered-templates.yaml
# The kubeval tool is installed to validate the rendered templates against the Kubernetes API schemas.
- name: Install kubeval
run: |
curl -LO "https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz"
tar xf kubeval-linux-amd64.tar.gz
sudo mv kubeval /usr/local/bin/
# The rendered templates are validated using kubeval, which checks if the Kubernetes manifests in the Helm charts adhere to the Kubernetes API schemas.
- name: Validate Rendered Templates
run: |
kubeval rendered-templates.yaml
# - name: Install Helm
# run: |
# curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
# # Validate that the Helm charts adhere to the proper structure and contain the necessary files.
# # This includes checking for the presence of Chart.yaml, values.yaml, and other required files.
# - name: Validate Helm Charts
# run: |
# helm repo add stable https://charts.helm.sh/stable
# helm repo update
# helm lint charts/memgraph/
# # The Helm templates are rendered using the helm template command,
# # and the output is stored in a file named rendered-templates.yaml.
# # This step ensures that there are no syntax or rendering errors in the templates.
# - name: Render Helm Templates
# run: |
# helm template charts/memgraph/ > rendered-templates.yaml
# # The kubeval tool is installed to validate the rendered templates against the Kubernetes API schemas.
# - name: Install kubeval
# run: |
# curl -LO "https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz"
# tar xf kubeval-linux-amd64.tar.gz
# sudo mv kubeval /usr/local/bin/
# # The rendered templates are validated using kubeval, which checks if the Kubernetes manifests in the Helm charts adhere to the Kubernetes API schemas.
# - name: Validate Rendered Templates
# run: |
# kubeval rendered-templates.yaml
18 changes: 6 additions & 12 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Lint and Test Charts

on:
pull_request:
branches:
- main
push:
branches:
- main
on: pull_request

jobs:
lint-test:
Expand All @@ -20,15 +14,15 @@ jobs:
- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: v3.12.1
version: v3.14.0

- uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.12'
check-latest: true

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
Expand All @@ -44,8 +38,8 @@ jobs:

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.7.0
uses: helm/kind-action@v1.8.0

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
run: ct install --target-branch ${{ github.event.repository.default_branch }}

0 comments on commit 71f4210

Please sign in to comment.