Skip to content

Commit

Permalink
Create Helm CI action.yml (#121)
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Titsworth <[email protected]>
Co-authored-by: Sharvil Shah <[email protected]>
  • Loading branch information
Tyler Titsworth and sharvil10 authored Jun 11, 2024
1 parent ab44915 commit 3dd3db5
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions workflows/charts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Copyright (c) 2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
name: Test Helm Charts
description: Given the inputs found below lint, install, and test all (or modified) helm Charts
author: [email protected]
inputs:
cluster_context:
description: k8s cluster context
default: 'kubeflow'
required: false
type: string
config:
description: extra configuration for chart-testing
default: '--debug --namespace helm-ci'
required: false
type: string
config_path:
description: path to chart-testing configuration file
required: false
default: '.github/ct.yaml'
type: string
list_changed:
description: Only test charts that have been modified
required: false
default: true
type: boolean
kubeconfig_path:
description: Path to config.yaml for a k8s cluster
required: true
type: string
runs:
using: composite
steps:
- uses: azure/setup-kubectl@v4
- uses: azure/setup-helm@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Setup chart-testing
uses: helm/[email protected]
- name: Get chart diff
id: changed
if: ${{ fromJson(inputs.list_changed) }}
shell: bash
run: |
changed=$(ct list-changed --config ${{ inputs.config_path }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Helm Lint, Install, and Test
if: ${{ steps.changed.outputs.changed == 'true' || !fromJson(inputs.list_changed) }}
shell: bash
run: |
install -m 0600 ${{ inputs.kubeconfig_path }} /tmp/config.yaml
kubectl config use-context ${{ inputs.cluster_context }}
ct lint-and-install --config ${{ inputs.config_path }} ${{ inputs.config }}
env:
KUBECONFIG: /tmp/config.yaml

0 comments on commit 3dd3db5

Please sign in to comment.