chore(deps): update all non-major dependencies #1557
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint and Test Charts | |
on: | |
pull_request: | |
branches: [master] | |
permissions: read-all | |
# https://stackoverflow.com/a/72408109 | |
concurrency: | |
cancel-in-progress: true | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
container: ghcr.io/chgl/kube-powertools:v2.3.18@sha256:68fc92c61b54c52eb4f46e5197063e9bf6f87b040653dbfd3989802ad07b28f0 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
egress-policy: audit # change to 'egress-policy: block' after couple of runs | |
disable-sudo: true | |
disable-telemetry: true | |
- name: Add workspace as safe directory | |
run: | | |
git config --global --add safe.directory /__w/charts/charts | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
# via <https://github.com/helm/chart-testing/issues/577> | |
- run: | | |
git branch "master" "origin/master" | |
- name: Check if documentation is up-to-date | |
run: | | |
generate-docs.sh | |
if git diff --exit-code HEAD; then | |
echo -e "\033[0;32mDocumentation up to date\033[0m ✔" | |
else | |
echo -e "\033[0;31mDocumentation outdated! Please run generate-docs.sh locally and push the changes.\033[0m ❌" | |
git diff --color | |
exit 1 | |
fi | |
- name: Update dependencies | |
run: find charts/ ! -path charts/ -maxdepth 1 -type d -exec helm dependency update {} \; | |
- name: Run YAML lint | |
run: yamllint . | |
- name: Run chart-testing (lint) | |
run: ct lint --config .github/ct/ct.yaml | |
- name: Run ArtifactHub lint | |
run: ah lint --kind=helm | |
- name: Cache kubeconform schemas | |
id: cache-powerlint-kubeconform | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: /tmp | |
key: ${{ runner.os }}-powerlint-kubeconform | |
- name: Run Powerlint | |
env: | |
KUBERNETES_VERSIONS: "1.28.0 1.29.0 1.30.0" | |
run: chart-powerlint.sh | |
# used to test whether the changelog generation process works | |
- name: Generate changelogs (test) | |
run: generate-chart-changelog.sh | |
test: | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint | |
strategy: | |
matrix: | |
k8s-version: [1.28.9, 1.29.4, 1.30.2] | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
egress-policy: audit # change to 'egress-policy: block' after couple of runs | |
disable-sudo: true | |
disable-telemetry: true | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1 | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed) | |
if [[ -n "$changed" ]]; then | |
echo "changed=true" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: Create k8s Kind Cluster | |
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 | |
if: ${{steps.list-changed.outputs.changed == 'true'}} | |
with: | |
cluster_name: kind-cluster-k8s-${{ matrix.k8s-version }} | |
node_image: kindest/node:v${{ matrix.k8s-version }} | |
- name: Run chart-testing (install) | |
run: ct install --config .github/ct/install.yaml | |
generate-renovate-chart-changelogs: | |
runs-on: ubuntu-22.04 | |
# run only on PRs created by renovate | |
# TODO: also check if the author of the last commit was renovate | |
# ${{ startsWith(github.head_ref, 'renovate/') }} | |
if: ${{ false }} | |
needs: | |
- test | |
container: ghcr.io/chgl/kube-powertools:v2.3.18@sha256:68fc92c61b54c52eb4f46e5197063e9bf6f87b040653dbfd3989802ad07b28f0 | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Add workspace as safe directory | |
run: | | |
git config --global --add safe.directory /__w/charts/charts | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Generate Chart.yaml changelog for renovate PRs | |
run: | | |
HEAD_COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s") | |
CHANGELOG_ENTRY=$(cat << EOF | |
# When using the list of objects option the valid supported kinds are | |
# added, changed, deprecated, removed, fixed and security. | |
- kind: changed | |
description: "${HEAD_COMMIT_MESSAGE}" | |
EOF | |
) | |
export CHANGELOG_ENTRY | |
CHANGED_CHARTS=$(ct list-changed) | |
for CHART in $CHANGED_CHARTS | |
do | |
echo "$CHART: updating Chart.yaml with auto-generated changelog annotation" | |
yq -i '.annotations."artifacthub.io/changes" = strenv(CHANGELOG_ENTRY)' "$CHART/Chart.yaml" | |
done | |
- name: Add and commit updated Chart.yaml changelogs | |
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4 | |
with: | |
message: "docs: auto-generated Chart.yaml changelog annotations" |