ci: modify flow #165
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
## Reference: https://github.com/helm/chart-testing-action | |
name: Lint | |
on: pull_request | |
permissions: | |
contents: read | |
jobs: | |
docs-up-to-date: | |
name: Docs Up To Date | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Install Helm Docs | |
uses: envoy/install-helm-docs@v1.0.0 | |
with: | |
version: 1.11.0 | |
- name: Update Helm Docs | |
run: | | |
set -ex | |
helm-docs | |
- name: Check for changes in generated Helm docs models (helm-docs) | |
run: | | |
./scripts/helm-docs.sh | |
changed=$(git status -s -uno | wc -l) | |
echo -e "### Git status" >> $GITHUB_STEP_SUMMARY | |
if [[ "$changed" -gt 0 ]]; then | |
echo "Generating helm-docs" | |
helm-docs | |
git config --global user.name "testkube-cloud-ci-bot" | |
git config --global user.email "testkube-cloud-ci-bot@users.noreply.github.com" | |
git add **/*README.md | |
git commit -m "Updating helm-chart versions and README files" | |
git push | |
else | |
echo "Docs are up to date" | |
fi | |
exit $changed | |
chart-test: | |
name: Chart lint | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.10.1 # Also update in publish.yaml | |
- name: Set up python | |
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0 # v4.6.1 | |
with: | |
python-version: 3.9 | |
- name: Setup Chart Linting | |
id: lint | |
uses: helm/chart-testing-action@v2.4.0 | |
- name: List changed charts | |
id: list-changed | |
run: | | |
## If executed with debug this won't work anymore. | |
changed=$(ct --target-branch ${{ github.event.pull_request.head.ref }} --config ./.github/configs/ct-lint.yaml list-changed) | |
charts=$(echo "$changed" | tr '\n' ' ' | xargs) | |
if [[ -n "$changed" ]]; then | |
echo "changed=true" >> $GITHUB_OUTPUT | |
echo "changed_charts=$charts" >> $GITHUB_OUTPUT | |
fi | |
- name: Run chart-testing (lint) | |
run: ct lint --debug --target-branch ${{ github.event.pull_request.head.ref }} --config ./.github/configs/ct-lint.yaml --lint-conf ./.github/configs/lintconf.yaml |