Update charts-lint.yaml
This commit is contained in:
@@ -11,31 +11,26 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
generate-lint-matrix:
|
||||||
name: Lint charts
|
name: Generate matrix for lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: |
|
||||||
|
{
|
||||||
|
"chart": ${{ steps.list-changed.outputs.charts }}
|
||||||
|
}
|
||||||
|
detected: ${{ steps.list-changed.outputs.detected }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ inputs.checkoutCommit }}
|
ref: ${{ inputs.checkoutCommit }}
|
||||||
|
|
||||||
- name: Install Kubernetes tools
|
|
||||||
uses: yokawasa/action-setup-kube-tools@c81bf94cddd6c3172e6f61aa7f5ad66a2b5db98d # tag=v0.8.0
|
|
||||||
with:
|
|
||||||
setup-tools: |
|
|
||||||
helmv3
|
|
||||||
helm: "3.8.0"
|
|
||||||
|
|
||||||
- uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3
|
|
||||||
with:
|
|
||||||
python-version: "3.10"
|
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@dae259e86a35ff09145c0805e2d7dd3f7207064a # tag=v2.2.1
|
uses: helm/chart-testing-action@v2.2.1
|
||||||
|
|
||||||
- name: Collect changes
|
- name: Run chart-testing (list-changed)
|
||||||
id: list-changed
|
id: list-changed
|
||||||
if: inputs.chartChangesDetected == 'true'
|
if: inputs.chartChangesDetected == 'true'
|
||||||
run: |
|
run: |
|
||||||
@@ -48,7 +43,50 @@ jobs:
|
|||||||
echo "::set-output name=detected::true"
|
echo "::set-output name=detected::true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
lint-charts:
|
||||||
|
needs:
|
||||||
|
- generate-lint-matrix
|
||||||
|
if: needs.generate-lint-matrix.outputs.detected == 'true'
|
||||||
|
name: lint charts
|
||||||
|
strategy:
|
||||||
|
matrix: ${{ fromJson(needs.generate-lint-matrix.outputs.matrix) }}
|
||||||
|
fail-fast: true
|
||||||
|
max-parallel: 15
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ inputs.checkoutCommit }}
|
||||||
|
|
||||||
|
- name: lint Kubernetes tools
|
||||||
|
uses: yokawasa/action-setup-kube-tools@v0.8.0
|
||||||
|
with:
|
||||||
|
setup-tools: |
|
||||||
|
helmv3
|
||||||
|
helm: "3.8.0"
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Set up chart-testing
|
||||||
|
uses: helm/chart-testing-action@v2.2.1
|
||||||
|
|
||||||
- name: Run chart-testing (lint)
|
- name: Run chart-testing (lint)
|
||||||
id: lint
|
run: ct lint --config .github/ct-lint.yaml --charts ${{ matrix.chart }}
|
||||||
if: steps.list-changed.outputs.detected == 'true'
|
|
||||||
run: ct lint --config .github/ct-lint.yaml
|
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
|
||||||
|
lint_success:
|
||||||
|
needs:
|
||||||
|
- generate-lint-matrix
|
||||||
|
- lint-charts
|
||||||
|
if: |
|
||||||
|
always()
|
||||||
|
name: Lint successful
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check lint matrix status
|
||||||
|
if: ${{ (needs.generate-lint-matrix.outputs.detected == 'true') && (needs.lint-charts.result != 'success') }}
|
||||||
|
run: exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user