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
38d3f4a7bf
commit
4fad7de228
2 changed files with 43 additions and 31 deletions
44
.github/actions/collect-changes/action.yaml
vendored
44
.github/actions/collect-changes/action.yaml
vendored
|
@ -10,7 +10,7 @@ outputs:
|
|||
value: ${{ steps.filter.outputs.addedOrModified_files }}
|
||||
addedOrModifiedCharts:
|
||||
description: "A list of the charts changed"
|
||||
value: ${{ steps.filter-charts.outputs.addedOrModified }}
|
||||
value: ${{ steps.filter-charts.outputs.addedOrModifiedCharts }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
|
@ -24,22 +24,34 @@ runs:
|
|||
addedOrModified:
|
||||
- added|modified: 'charts/*/**'
|
||||
|
||||
# - name: Collect changed charts
|
||||
# if: |
|
||||
# steps.filter.outputs.addedOrModified == 'true'
|
||||
# id: filter-charts
|
||||
# shell: bash
|
||||
# run: |
|
||||
# CHARTS=()
|
||||
# PATHS=(${{ steps.filter.outputs.addedOrModified_files }})
|
||||
# # Get only the chart paths
|
||||
# for CHARTPATH in "${PATHS[@]}"
|
||||
# do
|
||||
# IFS='/' read -r -a path_parts <<< "${CHARTPATH}"
|
||||
# CHARTS+=("${path_parts[1]}/${path_parts[2]}")
|
||||
# done
|
||||
|
||||
# # Remove duplicates
|
||||
# CHARTS=( `printf "%s\n" "${CHARTS[@]}" | sort -u` )
|
||||
# # Set output to changed charts
|
||||
# printf "::set-output name=addedOrModifiedCharts::%s\n" "${CHARTS[*]}"
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@v2.2.1
|
||||
|
||||
- name: Collect changed charts
|
||||
if: |
|
||||
steps.filter.outputs.addedOrModified == 'true'
|
||||
id: filter-charts
|
||||
id: changed-charts
|
||||
shell: bash
|
||||
run: |
|
||||
CHARTS=()
|
||||
PATHS=(${{ steps.filter.outputs.addedOrModified_files }})
|
||||
# Get only the chart paths
|
||||
for CHARTPATH in "${PATHS[@]}"
|
||||
do
|
||||
IFS='/' read -r -a path_parts <<< "${CHARTPATH}"
|
||||
CHARTS+=("${path_parts[1]}/${path_parts[2]}")
|
||||
done
|
||||
|
||||
# Remove duplicates
|
||||
CHARTS=( `printf "%s\n" "${CHARTS[@]}" | sort -u` )
|
||||
CHARTS=$(ct list-changed --config .ci/ct/ct-lint.yaml)
|
||||
echo "Charts: ${CHARTS}"
|
||||
# Set output to changed charts
|
||||
printf "::set-output name=addedOrModified::%s\n" "${CHARTS[*]}"
|
||||
printf "::set-output name=addedOrModifiedCharts::%s\n" "${CHARTS[*]}"
|
||||
|
|
30
.github/workflows/pr-validate.yaml
vendored
30
.github/workflows/pr-validate.yaml
vendored
|
@ -18,14 +18,14 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
pr-metadata:
|
||||
uses: bjw-s/helm-charts/.github/workflows/pr-metadata.yaml@main
|
||||
uses: bjw-s/helm-charts/.github/workflows/pr-metadata.yaml@${{ github.event.pull_request.base.ref }}
|
||||
|
||||
pre-commit-check:
|
||||
uses: bjw-s/helm-charts/.github/workflows/pre-commit-check.yaml@main
|
||||
needs:
|
||||
- pr-metadata
|
||||
with:
|
||||
modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }}
|
||||
# pre-commit-check:
|
||||
# uses: bjw-s/helm-charts/.github/workflows/pre-commit-check.yaml@main
|
||||
# needs:
|
||||
# - pr-metadata
|
||||
# with:
|
||||
# modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }}
|
||||
|
||||
# charts-changelog:
|
||||
# uses: bjw-s/helm-charts/.github/workflows/charts-changelog.yaml@main
|
||||
|
@ -36,14 +36,14 @@ jobs:
|
|||
# isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }}
|
||||
# modifiedCharts: ${{ needs.pr-metadata.outputs.addedOrModifiedCharts }}
|
||||
|
||||
charts-lint:
|
||||
uses: bjw-s/helm-charts/.github/workflows/charts-lint.yaml@main
|
||||
needs:
|
||||
- pr-metadata
|
||||
- charts-changelog
|
||||
with:
|
||||
checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }}
|
||||
chartChangesDetected: ${{ needs.pr-metadata.outputs.addedOrModified }}
|
||||
# charts-lint:
|
||||
# uses: bjw-s/helm-charts/.github/workflows/charts-lint.yaml@main
|
||||
# needs:
|
||||
# - pr-metadata
|
||||
# - charts-changelog
|
||||
# with:
|
||||
# checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }}
|
||||
# chartChangesDetected: ${{ needs.pr-metadata.outputs.addedOrModified }}
|
||||
|
||||
# charts-test:
|
||||
# uses: bjw-s/helm-charts/.github/workflows/charts-test.yaml@main
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue