mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
ci: 🧠
This commit is contained in:
parent
e7e0d570ee
commit
0b58695040
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 }}
|
value: ${{ steps.filter.outputs.addedOrModified_files }}
|
||||||
addedOrModifiedCharts:
|
addedOrModifiedCharts:
|
||||||
description: "A list of the charts changed"
|
description: "A list of the charts changed"
|
||||||
value: ${{ steps.filter-charts.outputs.addedOrModified }}
|
value: ${{ steps.filter-charts.outputs.addedOrModifiedCharts }}
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
|
@ -24,22 +24,34 @@ runs:
|
||||||
addedOrModified:
|
addedOrModified:
|
||||||
- added|modified: 'charts/*/**'
|
- 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
|
- name: Collect changed charts
|
||||||
if: |
|
id: changed-charts
|
||||||
steps.filter.outputs.addedOrModified == 'true'
|
|
||||||
id: filter-charts
|
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
CHARTS=()
|
CHARTS=$(ct list-changed --config .ci/ct/ct-lint.yaml)
|
||||||
PATHS=(${{ steps.filter.outputs.addedOrModified_files }})
|
echo "Charts: ${CHARTS}"
|
||||||
# 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
|
# 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:
|
jobs:
|
||||||
pr-metadata:
|
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:
|
# pre-commit-check:
|
||||||
uses: bjw-s/helm-charts/.github/workflows/pre-commit-check.yaml@main
|
# uses: bjw-s/helm-charts/.github/workflows/pre-commit-check.yaml@main
|
||||||
needs:
|
# needs:
|
||||||
- pr-metadata
|
# - pr-metadata
|
||||||
with:
|
# with:
|
||||||
modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }}
|
# modifiedFiles: ${{ needs.pr-metadata.outputs.addedOrModifiedFiles }}
|
||||||
|
|
||||||
# charts-changelog:
|
# charts-changelog:
|
||||||
# uses: bjw-s/helm-charts/.github/workflows/charts-changelog.yaml@main
|
# uses: bjw-s/helm-charts/.github/workflows/charts-changelog.yaml@main
|
||||||
|
@ -36,14 +36,14 @@ jobs:
|
||||||
# isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }}
|
# isRenovatePR: ${{ needs.pr-metadata.outputs.isRenovatePR }}
|
||||||
# modifiedCharts: ${{ needs.pr-metadata.outputs.addedOrModifiedCharts }}
|
# modifiedCharts: ${{ needs.pr-metadata.outputs.addedOrModifiedCharts }}
|
||||||
|
|
||||||
charts-lint:
|
# charts-lint:
|
||||||
uses: bjw-s/helm-charts/.github/workflows/charts-lint.yaml@main
|
# uses: bjw-s/helm-charts/.github/workflows/charts-lint.yaml@main
|
||||||
needs:
|
# needs:
|
||||||
- pr-metadata
|
# - pr-metadata
|
||||||
- charts-changelog
|
# - charts-changelog
|
||||||
with:
|
# with:
|
||||||
checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }}
|
# checkoutCommit: ${{ needs.charts-changelog.outputs.commitHash }}
|
||||||
chartChangesDetected: ${{ needs.pr-metadata.outputs.addedOrModified }}
|
# chartChangesDetected: ${{ needs.pr-metadata.outputs.addedOrModified }}
|
||||||
|
|
||||||
# charts-test:
|
# charts-test:
|
||||||
# uses: bjw-s/helm-charts/.github/workflows/charts-test.yaml@main
|
# uses: bjw-s/helm-charts/.github/workflows/charts-test.yaml@main
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue