mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
ci: 🧠
This commit is contained in:
parent
f5a67d0150
commit
2f22fc96f3
2 changed files with 5 additions and 5 deletions
53
.github/workflows/charts-lint.yaml
vendored
Normal file
53
.github/workflows/charts-lint.yaml
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
name: "Charts: Lint"
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
checkoutCommit:
|
||||
required: true
|
||||
type: string
|
||||
chartChangesDetected:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Lint charts
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
- name: Install Kubernetes tools
|
||||
uses: yokawasa/action-setup-kube-tools@v0.8.2
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
helm: "3.8.0"
|
||||
|
||||
- name: Install Helm
|
||||
uses: Azure/setup-helm@v3.3
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@v2.2.1
|
||||
|
||||
- name: Collect changes
|
||||
id: list-changed
|
||||
if: inputs.chartChangesDetected == 'true'
|
||||
run: |
|
||||
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .ci/ct/ct-lint.yaml)
|
||||
CHARTS=$(ct list-changed --config .ci/ct/ct-lint.yaml)
|
||||
CHARTS_JSON=$(echo "${CHARTS}" | jq -R -s -c 'split("\n")[:-1]')
|
||||
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED}, \"all\": ${CHARTS_JSON}}" | jq -c '.all-.excluded')
|
||||
echo ::set-output name=charts::${OUTPUT_JSON}
|
||||
if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
||||
echo "::set-output name=detected::true"
|
||||
fi
|
||||
|
||||
- name: Run chart-testing (lint)
|
||||
id: lint
|
||||
if: steps.list-changed.outputs.detected == 'true'
|
||||
run: ct lint --config .ci/ct/ct-lint.yaml
|
Loading…
Add table
Add a link
Reference in a new issue