build: add CI to correctly rebase our automatic updates #304
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| docs: | |
| name: Documentation | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # to commit documentation changes | |
| pull-requests: write # to comment on PRs | |
| issues: write # to comment on PRs | |
| outputs: | |
| changes_detected: ${{ steps.auto-commit.outputs.changes_detected }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0 | |
| with: | |
| egress-policy: audit | |
| - name: Generate Bot Token | |
| id: generate_token | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| with: | |
| app-id: ${{ secrets.ACTIONS_MAINTENANCE_APP_ID }} | |
| private-key: ${{ secrets.ACTIONS_MAINTENANCE_PRIVATE_KEY }} | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ steps.generate_token.outputs.token }} | |
| persist-credentials: true | |
| - name: Setup Helm Environment | |
| uses: ./.github/actions/setup-helm | |
| - name: Build Helm dependencies | |
| uses: ./.github/actions/build-deps | |
| - name: Generate schemas | |
| run: helm schema --add-schema-reference | |
| - name: Run helm-docs | |
| uses: losisin/helm-docs-github-action@6f957579ac122ecc167bf515fe84e828686c9a15 # v1.7.1 | |
| with: | |
| chart-search-root: charts | |
| template-files: README.md.gotmpl | |
| - name: Commit documentation changes | |
| id: auto-commit | |
| uses: TimSchoenle/actions/actions/common/commit-changes@8f15b94f827ea2005c0e32cadc86bb50969633dd # actions-common-commit-changes-v1.1.4 | |
| with: | |
| commit_message: "docs: update Helm chart documentation and schemas" | |
| token: ${{ steps.generate_token.outputs.token }} | |
| - name: Comment on PR | |
| if: steps.auto-commit.outputs.changes_detected == 'true' | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 | |
| with: | |
| github-token: ${{ steps.generate_token.outputs.token }} | |
| script: | | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: '📚 Helm chart documentation and schema have been automatically updated.' | |
| }) | |
| unit-test: | |
| name: Unit Tests | |
| needs: docs | |
| if: needs.docs.outputs.changes_detected != 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # to checkout code | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Helm Environment | |
| uses: ./.github/actions/setup-helm | |
| - name: Build Helm dependencies | |
| uses: ./.github/actions/build-deps | |
| - name: Run unit tests | |
| run: | | |
| for chart in charts/*; do | |
| if [ -d "$chart/tests" ]; then | |
| echo "Running tests for $chart" | |
| helm unittest $chart | |
| else | |
| echo "No tests found for $chart, skipping..." | |
| fi | |
| done | |
| lint: | |
| name: Lint Charts | |
| needs: docs | |
| if: needs.docs.outputs.changes_detected != 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # to checkout code | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Helm Environment | |
| uses: ./.github/actions/setup-helm | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| with: | |
| python-version: '3.14' | |
| check-latest: true | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 | |
| - name: Run chart-testing (list-changed) | |
| id: list-changed | |
| run: | | |
| changed=$(ct list-changed --config ./.github/configs/ct-lint.yaml) | |
| if [[ -n "$changed" ]]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Run chart-testing (lint) | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: ct lint --debug --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml | |
| install: | |
| name: Install & Verify | |
| needs: [docs, lint] | |
| if: needs.docs.outputs.changes_detected != 'true' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # to checkout code | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup Helm Environment | |
| uses: ./.github/actions/setup-helm | |
| - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 | |
| with: | |
| python-version: '3.14' | |
| check-latest: true | |
| - name: Set up chart-testing | |
| uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 | |
| - name: Run chart-testing (list-changed) | |
| id: list-changed | |
| run: | | |
| changed=$(ct list-changed --config ./.github/configs/ct-lint.yaml) | |
| if [[ -n "$changed" ]]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create kind cluster | |
| if: steps.list-changed.outputs.changed == 'true' | |
| uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0 | |
| with: | |
| wait: '120s' | |
| - name: Run chart-testing (install) | |
| if: steps.list-changed.outputs.changed == 'true' | |
| run: ct install --config ./.github/configs/ct-lint.yaml | |
| renovate-validate: | |
| name: Validate Renovate Config | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # to checkout code | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Validate Renovate configuration | |
| uses: suzuki-shunsuke/github-action-renovate-config-validator@ee9f69e1f683ed0d08225086482b34fc9abe9300 # v2.1.0 | |