Skip to content

Commit

Permalink
Update workflow to test chart
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Nov 13, 2023
1 parent 4b4ea76 commit 119371e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/helm-chart-test-overrideName.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Test Charts Set Component OverrideName
name: Test Charts Install

on:
push:
paths:
- 'charts/selenium-grid/templates/*'
- 'charts/selenium-grid/**'
pull_request:
paths:
- 'charts/selenium-grid/templates/*'
- 'charts/selenium-grid/**'
workflow_dispatch:

jobs:
Expand All @@ -32,22 +32,19 @@ jobs:
- name: Set up chart-testing
uses: helm/[email protected]

- name: Build chart dependencies
run: |
helm repo add kedacore https://kedacore.github.io/charts
helm repo update
helm dependency build charts/selenium-grid
- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
changed=$(ct list-changed --config tests/chart-test.yaml)
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "{changed}={true}" >> $GITHUB_OUTPUT
fi
- name: Run chart-testing (lint)
run: ct lint --config tests/chart-test.yaml

- name: Create kind cluster
uses: helm/[email protected]

- name: Run chart-testing (install)
run: ct install --config tests/ChartTests/ct-nameOverride.yaml --target-branch ${{ github.event.repository.default_branch }}
run: ct install --config tests/chart-test.yaml
1 change: 1 addition & 0 deletions charts/selenium-grid/ci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `ci` folder should contain a `values-*.yaml` file with the desired values, and chart-testing will automatically use these values when running the `ct install` command. For more details, see this [helm/chart-testing-action](https://github.com/helm/chart-testing-action)
9 changes: 9 additions & 0 deletions charts/selenium-grid/ci/values-overrideName.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#These desired is used to test the overrideName of the component
hub:
nameOverride: my-hub-name
chromeNode:
nameOverride: my-chrome-name
firefoxNode:
nameOverride: my-firefox-name
edgeNode:
nameOverride: my-edge-name
4 changes: 0 additions & 4 deletions tests/ChartTests/ct-nameOverride.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions tests/chart-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target-branch: trunk
chart-dirs:
- charts
chart-repos:
- kedacore=https://kedacore.github.io/charts
upgrade: true
helm-extra-args: --timeout 600s
check-version-increment: false

0 comments on commit 119371e

Please sign in to comment.