mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-23 23:49:12 +00:00
ci: Expand PR validation flow
Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>
This commit is contained in:
parent
b4af8c56c1
commit
085bd01f1a
51
.github/workflows/charts-lint.yaml
vendored
Normal file
51
.github/workflows/charts-lint.yaml
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
name: "Charts: Lint"
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
checkoutCommit:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
modifiedCharts:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
name: Lint successful
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ inputs.checkoutCommit }}
|
||||||
|
|
||||||
|
- name: Install Helm
|
||||||
|
uses: azure/setup-helm@v1
|
||||||
|
with:
|
||||||
|
version: v3.6.3
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: 3.7
|
||||||
|
|
||||||
|
- name: Set up chart-testing
|
||||||
|
uses: helm/chart-testing-action@v2.1.0
|
||||||
|
|
||||||
|
- name: Collect changes
|
||||||
|
id: list-changed
|
||||||
|
run: |
|
||||||
|
EXCLUDED=$(yq eval -o=json '.excluded-charts // []' .github/ct-lint.yaml)
|
||||||
|
CHARTS=$(ct list-changed --config .github/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 .github/ct-lint.yaml
|
19
.github/workflows/pr-validate.yaml
vendored
19
.github/workflows/pr-validate.yaml
vendored
@ -10,13 +10,22 @@ concurrency:
|
|||||||
# cancel-in-progress: true
|
# cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pr-get-metadata:
|
pr-metadata:
|
||||||
uses: k8s-at-home/charts/.github/workflows/pr-get-metadata.yaml@master
|
uses: k8s-at-home/charts/.github/workflows/pr-get-metadata.yaml@master
|
||||||
|
|
||||||
charts-update-readme:
|
charts-readme:
|
||||||
uses: k8s-at-home/charts/.github/workflows/charts-update-readme.yaml@master
|
uses: k8s-at-home/charts/.github/workflows/charts-update-readme.yaml@master
|
||||||
needs:
|
needs:
|
||||||
- pr-get-metadata
|
- pr-metadata
|
||||||
with:
|
with:
|
||||||
isRenovatePR: ${{ needs.pr-get-metadata.outputs.isRenovatePR }}
|
isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }}
|
||||||
modifiedCharts: ${{ needs.pr-get-metadata.outputs.addedOrModifiedCharts }}
|
modifiedCharts: ${{ needs.pr-metadata.outputs.addedOrModifiedCharts }}
|
||||||
|
|
||||||
|
charts-lint:
|
||||||
|
uses: k8s-at-home/charts/.github/workflows/charts-lint.yaml@master
|
||||||
|
needs:
|
||||||
|
- pr-metadata
|
||||||
|
- charts-readme
|
||||||
|
with:
|
||||||
|
checkoutCommit: ${{ needs.charts-readme.outputs.commitHash }}
|
||||||
|
modifiedCharts: ${{ needs.pr-metadata.outputs.addedOrModifiedCharts }}
|
||||||
|
Loading…
Reference in New Issue
Block a user