Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for chart values #31

Merged
merged 2 commits into from
Jul 13, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install yq
uses: mikefarah/[email protected]
- name: Build chart for CI
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: |
Expand All @@ -34,6 +36,36 @@ jobs:
uses: azure/setup-helm@v1
with:
version: v3.7.1
- name: Set chart output
id: chart
run: |
CHART=$(find . -type f -name "elemental-operator*.tgz" -print)
echo "::set-output name=chart_name::$CHART"
- name: Test chart values
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: |
REPO=$(helm show values ${{ steps.chart.outputs.chart_name }}|yq .image.repository)
TAG=$(helm show values ${{ steps.chart.outputs.chart_name }}|yq .image.tag)
if [ "$REPO" != "quay.io/costoolkit/elemental-operator-ci" ];then
echo "REPO on the built chart is not the expected value"
echo "Expected quay.io/costoolkit/elemental-operator but got $REPO"
exit 1
fi
- name: Test release chart values
if: startsWith(github.ref, 'refs/tags/')
run: |
REPO=$(helm show values ${{ steps.chart.outputs.chart_name }}|yq .image.repository)
TAG=$(helm show values ${{ steps.chart.outputs.chart_name }}|yq .image.tag)
if [ "$REPO" != "quay.io/costoolkit/elemental-operator" ];then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that quay.io/costoolkit/elemental-operator is empty, are we going to build there images

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, on release, images tagged with a version should be pushed there, unfortunately we havent cut a release yet :D

echo "REPO on the built chart is not the expected value"
echo "Expected quay.io/costoolkit/elemental-operator but got $REPO"
exit 1
fi
if [ "$TAG" != "${GITHUB_REF##*/}" ];then
echo "TAG on the built chart is not the expected value"
echo "Expected ${GITHUB_REF##*/} but got $TAG"
exit 1
fi
- name: Build and push index
if: startsWith(github.ref, 'refs/tags/')
run: |
Expand Down