Files
helm-charts-hardened/.github/workflows/helm-chart-ci.yaml
T
dependabot[bot] 0197621fa4 Bump helm/kind-action from 1.7.0 to 1.8.0 (#384)
Bumps [helm/kind-action](https://github.com/helm/kind-action) from 1.7.0
to 1.8.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/helm/kind-action/releases">helm/kind-action's
releases</a>.</em></p>
<blockquote>
<h2>v1.8.0</h2>
<h2>What's Changed</h2>
<ul>
<li><a
href="https://redirect.github.com/helm/kind-action/issues/54">#54</a>
ignore the occasional post delete cluster by <a
href="https://github.com/jerry153fish"><code>@​jerry153fish</code></a>
in <a
href="https://redirect.github.com/helm/kind-action/pull/79">helm/kind-action#79</a></li>
<li>bump kind to v0.20.0 and script cleanup by <a
href="https://github.com/cpanato"><code>@​cpanato</code></a> in <a
href="https://redirect.github.com/helm/kind-action/pull/88">helm/kind-action#88</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/jerry153fish"><code>@​jerry153fish</code></a>
made their first contribution in <a
href="https://redirect.github.com/helm/kind-action/pull/79">helm/kind-action#79</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/helm/kind-action/compare/v1.7.0...v1.8.0">https://github.com/helm/kind-action/compare/v1.7.0...v1.8.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/helm/kind-action/commit/dda0770415bac9fc20092cacbc54aa298604d140"><code>dda0770</code></a>
bump kind to v0.20.0 and script cleanup (<a
href="https://redirect.github.com/helm/kind-action/issues/88">#88</a>)</li>
<li><a
href="https://github.com/helm/kind-action/commit/a2c862bdb666af911f88f48ba22f76a4f33c4588"><code>a2c862b</code></a>
<a href="https://redirect.github.com/helm/kind-action/issues/54">#54</a>
ignore the occasional post delete cluster (<a
href="https://redirect.github.com/helm/kind-action/issues/79">#79</a>)</li>
<li><a
href="https://github.com/helm/kind-action/commit/1307bb2fdec64b9400f7865196ea57b0f2efb30f"><code>1307bb2</code></a>
Bump actions/checkout from 3.5.2 to 3.5.3 (<a
href="https://redirect.github.com/helm/kind-action/issues/87">#87</a>)</li>
<li>See full diff in <a
href="https://github.com/helm/kind-action/compare/v1.7.0...v1.8.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=helm/kind-action&package-manager=github_actions&previous-version=1.7.0&new-version=1.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 09:01:07 -07:00

204 lines
6.0 KiB
YAML

name: Helm Chart CI
on:
workflow_dispatch:
pull_request:
types: [synchronize, opened, reopened]
paths:
- 'charts/**'
- '.github/workflows/helm-chart-ci.yaml'
- '.github/kind/conf/kind-config.yaml'
- '.github/tests/**/*.yaml'
- '.github/tests/**/*.sh'
- '.github/tests/**/*.json'
- 'examples/**/*.yaml'
- 'helm-docs.sh'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
HELM_VERSION: v3.12.0
PYTHON_VERSION: 3.11.3
CHART_TESTING_VERSION: v3.8.0
jobs:
checks:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
- name: Verify Docs updated
run: ./helm-docs.sh
- name: Verify Spire appVersion
run: |
set +e
BASEVER=$(yq e .appVersion Chart.yaml)
for FILE in spiffe-oidc-discovery-provider spire-agent spire-server; do
VER=$(yq .appVersion charts/$FILE/Chart.yaml)
if [ "$VER" != "$BASEVER" ]; then
{
echo "## Version mismatch"
echo
echo "There is a mismatch between the chart version ($BASEVER) and subchart version ($VER). The issue may be in file $FILE. Please fix."
} >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
done
- name: Check objects for images without overrides
run: |
set +e
set -o pipefail
# Look for image: definitions that are not templated. If we find none, exit is not 0 and we invert the error code to get the
# test to pass. Ignore tests for now...
grep -r "image:" charts/spire | grep "templates/" | grep -v 'image: {{ template "' > /tmp/findings
res=$?
if [ $res -eq 0 ]; then
{
echo "## Hardcoded images"
echo
echo ":x: These templates were found to be using statically defined images and not overridable ones. Please fix."
echo
cat /tmp/findings
} >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
lint-chart:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: ${{ env.HELM_VERSION }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup chart-testing
uses: helm/[email protected]
with:
version: ${{ env.CHART_TESTING_VERSION }}
- name: Run chart-testing (lint)
run: TARGET_BRANCH=${{ github.base_ref }} make lint${{ github.base_ref == 'release' && '-release' || '' }}
outputs:
changed: ${{ steps.list-changed.outputs.changed }}
build-matrix:
name: Build matrix
runs-on: ubuntu-22.04
needs: [lint-chart]
steps:
- name: Checkout
uses: actions/[email protected]
- id: set-matrix
name: Collect all tests
run: |
tests="$(echo -e "default\n$(find .github/tests -maxdepth 1 -type d | grep -Ev 'tests$' | xargs -I % basename % | sort | uniq)")"
tests_json="$(echo "$tests" | jq -c --slurp --raw-input 'split("\n") | map(select(. != ""))')"
echo "tests=$tests_json" >> $GITHUB_OUTPUT
outputs:
tests: ${{ steps.set-matrix.outputs.tests }}
test:
runs-on: ubuntu-22.04
needs:
- lint-chart
- build-matrix
strategy:
fail-fast: false
matrix:
# Choose tags corresponding to the version of Kind being used.
# At a minimum, we should test the currently supported versions of
# Kubernetes, but can go back farther as long as we don't need heroics
# to pull it off (i.e. kubectl version juggling).
k8s:
- v1.27.2
- v1.26.4
- v1.25.9
values:
- ${{ fromJson(needs.build-matrix.outputs.tests) }}
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/[email protected]
with:
version: ${{ env.HELM_VERSION }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup chart-testing
uses: helm/[email protected]
with:
version: ${{ env.CHART_TESTING_VERSION }}
- name: Create kind ${{ matrix.k8s }} cluster
uses: helm/[email protected]
# Only build a kind cluster if there are chart changes to test.
with:
version: v0.19.0
node_image: kindest/node:${{ matrix.k8s }}
config: .github/kind/conf/kind-config.yaml
verbosity: 1
- name: Run chart-testing (install)
run: |
post-install() {
[ -x "${TEST_DIR}/post-install.sh" ] && "${TEST_DIR}/post-install.sh" $1
exit $1
}
trap 'post-install $? $LINENO' EXIT
export scenario="$(basename "${TEST_DIR}")"
export EXTRA_HELM_ARGS=""
source .github/tests/charts.sh
[ "${scenario}" != "default" ] && kubectl create namespace "${scenario}"
[ -x "${TEST_DIR}/pre-install.sh" ] && "${TEST_DIR}/pre-install.sh"
[ -f "${TEST_DIR}/.env" ] && source "${TEST_DIR}/.env"
if [ -x "${TEST_DIR}/install.sh" ]; then
"${TEST_DIR}/install.sh"
else
ct install --debug \
--charts "charts/spire" \
--namespace "${scenario}" \
--target-branch ${{ github.base_ref }} \
--exclude-deprecated \
--skip-clean-up \
${{ (matrix.values != 'default' && '--helm-extra-set-args "--values=${TEST_DIR}/values.yaml ${EXTRA_HELM_ARGS}"') || '' }}
fi
env:
TEST_DIR: .github/tests/${{ matrix.values }}