Update charts-test.yaml
This commit is contained in:
committed by
GitHub
parent
f6fc29dd0d
commit
04550eba2c
83
.github/workflows/charts-test.yaml
vendored
83
.github/workflows/charts-test.yaml
vendored
@@ -16,13 +16,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
- name: Install Kubernetes tools
|
||||
uses: yokawasa/action-setup-kube-tools@c81bf94cddd6c3172e6f61aa7f5ad66a2b5db98d # tag=v0.8.0
|
||||
uses: yokawasa/action-setup-kube-tools@v0.8.0
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
@@ -49,20 +49,24 @@ jobs:
|
||||
name: Generate matrix for install
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: |
|
||||
matrix1: |
|
||||
{
|
||||
"chart": ${{ steps.list-changed.outputs.charts }}
|
||||
"chart": ${{ steps.list-changed.outputs.charts1 }}
|
||||
}
|
||||
matrix2: |
|
||||
{
|
||||
"chart": ${{ steps.list-changed.outputs.charts2 }}
|
||||
}
|
||||
detected: ${{ steps.list-changed.outputs.detected }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@dae259e86a35ff09145c0805e2d7dd3f7207064a # tag=v2.2.1
|
||||
uses: helm/chart-testing-action@v2.2.1
|
||||
|
||||
- name: Run chart-testing (list-changed)
|
||||
id: list-changed
|
||||
@@ -72,41 +76,87 @@ jobs:
|
||||
CHARTS=$(ct list-changed --config .github/ct-install.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}
|
||||
OUTPUT_JSON1=$(echo $CHARTS_JSON | jq -r -c '.[:254]')
|
||||
OUTPUT_JSON2=$(echo $CHARTS_JSON | jq -r -c '.[254:500]')
|
||||
echo ::set-output name=charts1::${OUTPUT_JSON1}
|
||||
echo ::set-output name=charts2::${OUTPUT_JSON2}
|
||||
if [[ $(echo ${OUTPUT_JSON} | jq -c '. | length') -gt 0 ]]; then
|
||||
echo "::set-output name=detected::true"
|
||||
fi
|
||||
|
||||
install-charts:
|
||||
install-charts1:
|
||||
needs:
|
||||
- generate-install-matrix
|
||||
if: needs.generate-install-matrix.outputs.detected == 'true'
|
||||
name: Install charts
|
||||
name: Install charts Part 1
|
||||
strategy:
|
||||
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix) }}
|
||||
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix1) }}
|
||||
fail-fast: true
|
||||
max-parallel: 15
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # tag=v3
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ inputs.checkoutCommit }}
|
||||
|
||||
- name: Install Kubernetes tools
|
||||
uses: yokawasa/action-setup-kube-tools@c81bf94cddd6c3172e6f61aa7f5ad66a2b5db98d # tag=v0.8.0
|
||||
uses: yokawasa/action-setup-kube-tools@v0.8.0
|
||||
with:
|
||||
setup-tools: |
|
||||
helmv3
|
||||
helm: "3.8.0"
|
||||
|
||||
- uses: actions/setup-python@0ebf233433c08fb9061af664d501c3f3ff0e9e20 # tag=v3
|
||||
- uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@dae259e86a35ff09145c0805e2d7dd3f7207064a # tag=v2.2.1
|
||||
uses: helm/chart-testing-action@v2.2.1
|
||||
|
||||
- name: Create k3d cluster
|
||||
uses: nolar/setup-k3d-k3s@v1
|
||||
with:
|
||||
version: v1.20
|
||||
|
||||
- name: Remove node taints
|
||||
run: |
|
||||
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
||||
|
||||
- name: Run chart-testing (install)
|
||||
run: ct install --config .github/ct-install.yaml --charts ${{ matrix.chart }} --upgrade
|
||||
|
||||
install-charts2:
|
||||
needs:
|
||||
- generate-install-matrix
|
||||
if: needs.generate-install-matrix.outputs.detected == 'true'
|
||||
name: Install charts Part 2
|
||||
strategy:
|
||||
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix1) }}
|
||||
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: Install 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: Create k3d cluster
|
||||
uses: nolar/setup-k3d-k3s@v1
|
||||
@@ -124,12 +174,13 @@ jobs:
|
||||
install_success:
|
||||
needs:
|
||||
- generate-install-matrix
|
||||
- install-charts
|
||||
- install-charts1
|
||||
- install-charts2
|
||||
if: |
|
||||
always()
|
||||
name: Install successful
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check install matrix status
|
||||
if: ${{ (needs.generate-install-matrix.outputs.detected == 'true') && (needs.install-charts.result != 'success') }}
|
||||
if: ${{ (needs.generate-install-matrix.outputs.detected == 'true') && (needs.install-charts1.result != 'success') && (needs.install-charts2.result != 'success') }}
|
||||
run: exit 1
|
||||
|
||||
Reference in New Issue
Block a user