Superset repackaging as beta release/helm packages build, test, lint, helm-docs, publication #2
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
# | |
# Copyright 2024 tosit.io | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: ci | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/**" | |
- ".github/actions/**" | |
- ".ct.yml" | |
- ".lintconf.yaml" | |
- "**/**" | |
- "!README.md" | |
- "!**/README.md" | |
- "!docs/**" | |
push: | |
branches: | |
- '**' | |
- '!gh-pages' | |
paths: | |
- ".github/workflows/**" | |
- ".github/actions/**" | |
- ".ct.yml" | |
- ".lintconf.yaml" | |
- "**/**" | |
- "!README.md" | |
- "!**/README.md" | |
- "!docs/**" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
# https://docs.github.com/en/actions/using-jobs/using-concurrency | |
concurrency: | |
# Only cancel in-progress jobs or runs for the current workflow - matches against branch & tags | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
helm-lint: | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout Repo ⚡️ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup helm | |
uses: azure/setup-helm@v4.2.0 | |
with: | |
version: v3.15.1 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Set up chart-testing | |
uses: helm/chart-testing-action@v2.6.1 | |
- name: Run chart-testing (list-changed) ✅ | |
id: list-changed | |
run: | | |
changed=$(ct list-changed --config .ct.yml --print-config) | |
if [[ -n "$changed" ]]; then | |
echo "list_changed=$(echo ${changed} | tr -d \')" >> "$GITHUB_OUTPUT" | |
echo "changed=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Run chart-testing (lint) ✅ | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct lint --config .ct.yml --check-version-increment=false --print-config | |
- name: Free up disk space 🧹 | |
if: steps.list-changed.outputs.changed == 'true' | |
uses: ./.github/actions/free-disk-space | |
- name: Set up kind cluster ✅ | |
if: steps.list-changed.outputs.changed == 'true' | |
uses: ./.github/actions/setup-kind | |
- name: Run chart-testing (install) ✅ | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct install --config .ct.yml --print-config | |
- name: Install helm-docs | |
if: steps.list-changed.outputs.changed == 'true' | |
uses: ./.github/actions/helm-docs | |
- name: Generate helm docs | |
if: steps.list-changed.outputs.changed == 'true' | |
run: | | |
echo "Generate docs from charts: ${{ steps.list-changed.outputs.list_changed }}" | |
helm-docs --chart-to-generate $(echo "${{ steps.list-changed.outputs.list_changed }}" | tr " " ",") | |
- name: Commit helm docs changes | |
# Github token from forked repo does not have permission to push to target repo | |
# Skip the step for PRs from forked repos | |
if: | | |
${{ steps.list-changed.outputs.changed == 'true' | |
&& ((github.event_name == 'push') || (github.event_name == 'pull_request' | |
&& github.event.pull_request.head.repo.full_name == github.repository)) }} | |
uses: EndBug/add-and-commit@v9 | |
with: | |
pull: "--rebase --autostash" | |
add: "**/README.md" | |
message: '[helm-docs] Update readme' | |
author_name: github-actions[bot] | |
author_email: 41898282+github-actions[bot]@users.noreply.github.com | |