2022-03-30 08:46:56 +00:00
|
|
|
name: "Charts: Test"
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
checkoutCommit:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
chartChangesDetected:
|
|
|
|
required: true
|
|
|
|
type: string
|
2023-05-28 17:28:55 +00:00
|
|
|
modifiedCharts:
|
|
|
|
required: true
|
|
|
|
type: string
|
2022-03-30 08:46:56 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate-install-matrix:
|
|
|
|
name: Generate matrix for install
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
2022-03-30 19:01:34 +00:00
|
|
|
matrix1: |
|
2022-03-30 08:46:56 +00:00
|
|
|
{
|
2022-03-30 19:01:34 +00:00
|
|
|
"chart": ${{ steps.list-changed.outputs.charts1 }}
|
|
|
|
}
|
|
|
|
matrix2: |
|
|
|
|
{
|
|
|
|
"chart": ${{ steps.list-changed.outputs.charts2 }}
|
2022-03-30 08:46:56 +00:00
|
|
|
}
|
2022-04-05 17:30:02 +00:00
|
|
|
matrix3: |
|
|
|
|
{
|
|
|
|
"chart": ${{ steps.list-changed.outputs.charts3 }}
|
|
|
|
}
|
|
|
|
matrix4: |
|
|
|
|
{
|
|
|
|
"chart": ${{ steps.list-changed.outputs.charts4 }}
|
|
|
|
}
|
|
|
|
matrix5: |
|
|
|
|
{
|
|
|
|
"chart": ${{ steps.list-changed.outputs.charts5 }}
|
|
|
|
}
|
|
|
|
matrix6: |
|
|
|
|
{
|
|
|
|
"chart": ${{ steps.list-changed.outputs.charts6 }}
|
|
|
|
}
|
2022-03-31 09:17:40 +00:00
|
|
|
detected1: ${{ steps.list-changed.outputs.detected1 }}
|
|
|
|
detected2: ${{ steps.list-changed.outputs.detected2 }}
|
2022-04-05 17:30:02 +00:00
|
|
|
detected3: ${{ steps.list-changed.outputs.detected3 }}
|
|
|
|
detected4: ${{ steps.list-changed.outputs.detected4 }}
|
|
|
|
detected5: ${{ steps.list-changed.outputs.detected5 }}
|
|
|
|
detected6: ${{ steps.list-changed.outputs.detected6 }}
|
2022-03-30 08:46:56 +00:00
|
|
|
steps:
|
2023-05-29 07:54:21 +00:00
|
|
|
- name: Checkout
|
2023-10-17 17:24:19 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2023-05-29 07:54:21 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
ref: ${{ inputs.checkoutCommit }}
|
2023-05-30 10:54:44 +00:00
|
|
|
|
2023-05-29 09:20:59 +00:00
|
|
|
- name: Install go-yq
|
|
|
|
run: |
|
|
|
|
mkdir -p $HOME/.local/bin
|
|
|
|
wget https://github.com/mikefarah/yq/releases/download/v4.26.1/yq_linux_amd64 -O $HOME/.local/bin/go-yq && \
|
|
|
|
chmod +x $HOME/.local/bin/go-yq
|
|
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
2023-05-29 07:54:21 +00:00
|
|
|
|
2022-03-30 08:46:56 +00:00
|
|
|
- name: Run chart-testing (list-changed)
|
|
|
|
id: list-changed
|
|
|
|
if: inputs.chartChangesDetected == 'true'
|
2023-05-28 21:55:02 +00:00
|
|
|
shell: bash
|
2022-03-30 08:46:56 +00:00
|
|
|
run: |
|
2023-05-28 19:36:35 +00:00
|
|
|
CHARTS="${{ inputs.modifiedCharts }}"
|
2023-05-28 17:28:55 +00:00
|
|
|
echo "Modified Charts: ${CHARTS}"
|
2023-05-28 21:38:21 +00:00
|
|
|
EXCLUDED_JSON=$(go-yq eval -o=json '.excluded-charts // []' .github/ct-install.yaml)
|
2023-05-29 08:31:53 +00:00
|
|
|
CHARTS_JSON=$(echo ${CHARTS} | jq --raw-input '.' | jq --compact-output --slurp '.' | jq 'map(. |= split(" "))[]' )
|
2023-05-28 21:38:21 +00:00
|
|
|
OUTPUT_JSON=$(echo "{\"excluded\": ${EXCLUDED_JSON}, \"all\": ${CHARTS_JSON}}" | jq --compact-output '.all-.excluded')
|
2022-06-07 17:41:19 +00:00
|
|
|
OUTPUT_JSON1=$((echo $OUTPUT_JSON | jq -r -c '.[:50]'; echo $OUTPUT_JSON | jq -r -c '.[301:350]'; echo $OUTPUT_JSON | jq -r -c '.[601:650]'; echo $OUTPUT_JSON | jq -r -c '.[901:950]'; echo $OUTPUT_JSON | jq -r -c '.[1201:1250]') | jq -s add)
|
|
|
|
OUTPUT_JSON2=$((echo $OUTPUT_JSON | jq -r -c '.[51:100]'; echo $OUTPUT_JSON | jq -r -c '.[351:400]'; echo $OUTPUT_JSON | jq -r -c '.[651:700]'; echo $OUTPUT_JSON | jq -r -c '.[951:1000]'; echo $OUTPUT_JSON | jq -r -c '.[1251:1300]') | jq -s add)
|
|
|
|
OUTPUT_JSON3=$((echo $OUTPUT_JSON | jq -r -c '.[101:150]'; echo $OUTPUT_JSON | jq -r -c '.[401:450]'; echo $OUTPUT_JSON | jq -r -c '.[701:750]'; echo $OUTPUT_JSON | jq -r -c '.[1001:1050]'; echo $OUTPUT_JSON | jq -r -c '.[1301:1350]') | jq -s add)
|
|
|
|
OUTPUT_JSON4=$((echo $OUTPUT_JSON | jq -r -c '.[151:200]'; echo $OUTPUT_JSON | jq -r -c '.[451:500]'; echo $OUTPUT_JSON | jq -r -c '.[751:800]'; echo $OUTPUT_JSON | jq -r -c '.[1051:1100]'; echo $OUTPUT_JSON | jq -r -c '.[1351:1400]') | jq -s add)
|
|
|
|
OUTPUT_JSON5=$((echo $OUTPUT_JSON | jq -r -c '.[201:250]'; echo $OUTPUT_JSON | jq -r -c '.[501:550]'; echo $OUTPUT_JSON | jq -r -c '.[801:850]'; echo $OUTPUT_JSON | jq -r -c '.[1101:1150]'; echo $OUTPUT_JSON | jq -r -c '.[1401:1450]') | jq -s add)
|
|
|
|
OUTPUT_JSON6=$((echo $OUTPUT_JSON | jq -r -c '.[251:300]'; echo $OUTPUT_JSON | jq -r -c '.[551:600]'; echo $OUTPUT_JSON | jq -r -c '.[851:900]'; echo $OUTPUT_JSON | jq -r -c '.[1151:1200]'; echo $OUTPUT_JSON | jq -r -c '.[1451:1500]') | jq -s add)
|
2023-05-30 10:54:44 +00:00
|
|
|
echo charts1=${OUTPUT_JSON1} >> $GITHUB_OUTPUT
|
|
|
|
echo charts2=${OUTPUT_JSON2} >> $GITHUB_OUTPUT
|
|
|
|
echo charts3=${OUTPUT_JSON3} >> $GITHUB_OUTPUT
|
|
|
|
echo charts4=${OUTPUT_JSON4} >> $GITHUB_OUTPUT
|
|
|
|
echo charts5=${OUTPUT_JSON5} >> $GITHUB_OUTPUT
|
|
|
|
echo charts6=${OUTPUT_JSON6} >> $GITHUB_OUTPUT
|
2022-03-31 09:17:40 +00:00
|
|
|
if [[ $(echo ${OUTPUT_JSON1} | jq -c '. | length') -gt 0 ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "detected1=true" >> $GITHUB_OUTPUT
|
2022-03-31 09:17:40 +00:00
|
|
|
fi
|
|
|
|
if [[ $(echo ${OUTPUT_JSON2} | jq -c '. | length') -gt 0 ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "detected2=true" >> $GITHUB_OUTPUT
|
2022-03-30 08:46:56 +00:00
|
|
|
fi
|
2022-04-05 17:30:02 +00:00
|
|
|
if [[ $(echo ${OUTPUT_JSON3} | jq -c '. | length') -gt 0 ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "detected3=true" >> $GITHUB_OUTPUT
|
2022-04-05 17:30:02 +00:00
|
|
|
fi
|
|
|
|
if [[ $(echo ${OUTPUT_JSON4} | jq -c '. | length') -gt 0 ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "detected4=true" >> $GITHUB_OUTPUT
|
2022-04-05 17:30:02 +00:00
|
|
|
fi
|
|
|
|
if [[ $(echo ${OUTPUT_JSON5} | jq -c '. | length') -gt 0 ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "detected5=true" >> $GITHUB_OUTPUT
|
2022-04-05 17:30:02 +00:00
|
|
|
fi
|
|
|
|
if [[ $(echo ${OUTPUT_JSON6} | jq -c '. | length') -gt 0 ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "detected6=true" >> $GITHUB_OUTPUT
|
2022-04-05 17:30:02 +00:00
|
|
|
fi
|
2022-03-30 08:46:56 +00:00
|
|
|
|
2022-03-30 19:01:34 +00:00
|
|
|
install-charts1:
|
|
|
|
needs:
|
|
|
|
- generate-install-matrix
|
2022-03-31 09:17:40 +00:00
|
|
|
if: needs.generate-install-matrix.outputs.detected1 == 'true'
|
2022-03-30 19:01:34 +00:00
|
|
|
name: Install charts Part 1
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix1) }}
|
2022-03-30 19:22:26 +00:00
|
|
|
fail-fast: false
|
2022-08-08 19:17:50 +00:00
|
|
|
max-parallel: 10
|
2022-03-30 19:01:34 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-17 17:24:19 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-03-30 19:01:34 +00:00
|
|
|
with:
|
2023-05-28 17:28:55 +00:00
|
|
|
fetch-depth: 1
|
2022-03-30 19:01:34 +00:00
|
|
|
ref: ${{ inputs.checkoutCommit }}
|
|
|
|
|
2023-11-05 11:01:27 +00:00
|
|
|
- name: Install Helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
|
2022-03-30 19:01:34 +00:00
|
|
|
with:
|
2023-11-12 23:14:46 +00:00
|
|
|
version: v3.13.2
|
2022-03-30 19:01:34 +00:00
|
|
|
|
2023-12-06 18:23:29 +00:00
|
|
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
|
2022-03-30 19:01:34 +00:00
|
|
|
with:
|
2023-05-30 10:54:44 +00:00
|
|
|
python-version: "3.11"
|
2022-03-30 19:01:34 +00:00
|
|
|
|
|
|
|
- name: Set up chart-testing
|
2023-11-03 14:27:24 +00:00
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
2022-03-30 19:01:34 +00:00
|
|
|
|
|
|
|
- name: Create k3d cluster
|
|
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
|
|
with:
|
2023-11-05 11:01:27 +00:00
|
|
|
version: latest
|
2023-01-15 17:25:23 +00:00
|
|
|
# Flags found here https://github.com/k3d-io/k3d
|
|
|
|
k3d-args: --k3s-arg --disable=metrics-server@server:*
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-03-30 19:01:34 +00:00
|
|
|
- name: Remove node taints
|
|
|
|
run: |
|
|
|
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
|
|
|
|
2023-07-31 17:34:55 +00:00
|
|
|
- name: Prep Helm
|
|
|
|
run: |
|
|
|
|
helm repo add truecharts https://charts.truecharts.org
|
|
|
|
helm repo add truecharts-deps https://deps.truecharts.org
|
|
|
|
helm repo add truecharts-library https://library-charts.truecharts.org
|
|
|
|
helm repo add jetstack https://charts.jetstack.io
|
2023-11-14 13:12:27 +00:00
|
|
|
helm repo add vmwaretanzu https://vmware-tanzu.github.io/helm-charts
|
2023-11-15 14:39:03 +00:00
|
|
|
helm repo add cnpg https://cloudnative-pg.github.io/charts
|
|
|
|
helm repo add metallb https://metallb.github.io/metallb
|
|
|
|
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
|
2023-12-05 18:50:03 +00:00
|
|
|
helm repo add openebs https://openebs.github.io/charts
|
|
|
|
helm repo add csi-driver-smb https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts
|
|
|
|
helm repo add csi-driver-nfs https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/charts
|
2023-07-31 17:34:55 +00:00
|
|
|
helm repo update
|
|
|
|
|
2023-06-07 10:44:38 +00:00
|
|
|
- name: Add Dependencies
|
|
|
|
run: |
|
2023-07-31 10:32:04 +00:00
|
|
|
if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait
|
|
|
|
fi
|
|
|
|
## TODO: Only add when required
|
|
|
|
if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then
|
|
|
|
helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait
|
2023-06-09 07:25:15 +00:00
|
|
|
fi
|
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
2023-10-07 23:16:09 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/enterprise/traefik" ]]; then
|
|
|
|
helm install traefik truecharts/traefik --namespace traefik --create-namespace --wait
|
|
|
|
fi
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-03-30 19:01:34 +00:00
|
|
|
- name: Run chart-testing (install)
|
2023-06-07 10:44:38 +00:00
|
|
|
run: ct install --config ".github/ct-install.yaml" --charts "${{ matrix.chart }}" # --upgrade
|
2022-04-05 17:30:02 +00:00
|
|
|
|
2022-03-30 19:01:34 +00:00
|
|
|
install-charts2:
|
2022-03-30 08:46:56 +00:00
|
|
|
needs:
|
|
|
|
- generate-install-matrix
|
2022-03-31 09:17:40 +00:00
|
|
|
if: needs.generate-install-matrix.outputs.detected2 == 'true'
|
2022-03-30 19:01:34 +00:00
|
|
|
name: Install charts Part 2
|
2022-03-30 08:46:56 +00:00
|
|
|
strategy:
|
2022-03-31 09:17:40 +00:00
|
|
|
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix2) }}
|
2022-03-30 19:22:26 +00:00
|
|
|
fail-fast: false
|
2022-08-08 19:17:50 +00:00
|
|
|
max-parallel: 10
|
2022-03-30 08:46:56 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-17 17:24:19 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
2023-05-28 17:28:55 +00:00
|
|
|
fetch-depth: 1
|
2022-03-30 08:46:56 +00:00
|
|
|
ref: ${{ inputs.checkoutCommit }}
|
|
|
|
|
2023-11-05 11:01:27 +00:00
|
|
|
- name: Install Helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
2023-11-12 23:14:46 +00:00
|
|
|
version: v3.13.2
|
2022-03-30 08:46:56 +00:00
|
|
|
|
2023-12-06 18:23:29 +00:00
|
|
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
|
2022-03-30 08:46:56 +00:00
|
|
|
with:
|
2023-05-30 10:54:44 +00:00
|
|
|
python-version: "3.11"
|
2022-03-30 08:46:56 +00:00
|
|
|
|
|
|
|
- name: Set up chart-testing
|
2023-11-03 14:27:24 +00:00
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
2022-03-30 08:46:56 +00:00
|
|
|
|
|
|
|
- name: Create k3d cluster
|
|
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
|
|
with:
|
2023-11-05 11:01:27 +00:00
|
|
|
version: latest
|
2023-01-15 17:25:23 +00:00
|
|
|
# Flags found here https://github.com/k3d-io/k3d
|
|
|
|
k3d-args: --k3s-arg --disable=metrics-server@server:*
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-30 08:46:56 +00:00
|
|
|
|
|
|
|
- name: Remove node taints
|
|
|
|
run: |
|
|
|
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
|
|
|
|
2023-06-07 10:44:38 +00:00
|
|
|
- name: Add Dependencies
|
|
|
|
run: |
|
2023-07-31 10:32:04 +00:00
|
|
|
if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait
|
|
|
|
fi
|
|
|
|
## TODO: Only add when required
|
|
|
|
if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then
|
|
|
|
helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
2023-06-09 07:25:15 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait
|
2023-06-09 07:25:15 +00:00
|
|
|
fi
|
2023-10-07 23:16:09 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/enterprise/traefik" ]]; then
|
|
|
|
helm install traefik truecharts/traefik --namespace traefik --create-namespace --wait
|
|
|
|
fi
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-03-30 08:46:56 +00:00
|
|
|
- name: Run chart-testing (install)
|
2023-06-07 10:44:38 +00:00
|
|
|
run: ct install --config ".github/ct-install.yaml" --charts "${{ matrix.chart }}" # --upgrade
|
2022-03-30 08:46:56 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
install-charts3:
|
|
|
|
needs:
|
|
|
|
- generate-install-matrix
|
|
|
|
if: needs.generate-install-matrix.outputs.detected3 == 'true'
|
|
|
|
name: Install charts Part 3
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix3) }}
|
|
|
|
fail-fast: false
|
2022-08-08 19:17:50 +00:00
|
|
|
max-parallel: 10
|
2022-04-05 17:30:02 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-17 17:24:19 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-28 17:28:55 +00:00
|
|
|
fetch-depth: 1
|
2022-04-05 17:30:02 +00:00
|
|
|
ref: ${{ inputs.checkoutCommit }}
|
|
|
|
|
2023-11-05 11:01:27 +00:00
|
|
|
- name: Install Helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-11-12 23:14:46 +00:00
|
|
|
version: v3.13.2
|
2022-04-05 17:30:02 +00:00
|
|
|
|
2023-12-06 18:23:29 +00:00
|
|
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-30 10:54:44 +00:00
|
|
|
python-version: "3.11"
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Set up chart-testing
|
2023-11-03 14:27:24 +00:00
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Create k3d cluster
|
|
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
|
|
with:
|
2023-11-05 11:01:27 +00:00
|
|
|
version: latest
|
2023-01-15 17:25:23 +00:00
|
|
|
# Flags found here https://github.com/k3d-io/k3d
|
|
|
|
k3d-args: --k3s-arg --disable=metrics-server@server:*
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Remove node taints
|
|
|
|
run: |
|
|
|
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
|
|
|
|
2023-06-07 10:44:38 +00:00
|
|
|
- name: Add Dependencies
|
|
|
|
run: |
|
2023-07-31 10:32:04 +00:00
|
|
|
if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait
|
|
|
|
fi
|
|
|
|
## TODO: Only add when required
|
|
|
|
if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then
|
|
|
|
helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
2023-06-09 07:25:15 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait
|
2023-06-09 07:25:15 +00:00
|
|
|
fi
|
2023-10-07 23:16:09 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/enterprise/traefik" ]]; then
|
|
|
|
helm install traefik truecharts/traefik --namespace traefik --create-namespace --wait
|
|
|
|
fi
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Run chart-testing (install)
|
2023-06-07 10:44:38 +00:00
|
|
|
run: ct install --config ".github/ct-install.yaml" --charts "${{ matrix.chart }}" # --upgrade
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
install-charts4:
|
|
|
|
needs:
|
|
|
|
- generate-install-matrix
|
|
|
|
if: needs.generate-install-matrix.outputs.detected4 == 'true'
|
|
|
|
name: Install charts Part 4
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix4) }}
|
|
|
|
fail-fast: false
|
2022-08-08 19:17:50 +00:00
|
|
|
max-parallel: 10
|
2022-04-05 17:30:02 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-17 17:24:19 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-28 17:28:55 +00:00
|
|
|
fetch-depth: 1
|
2022-04-05 17:30:02 +00:00
|
|
|
ref: ${{ inputs.checkoutCommit }}
|
|
|
|
|
2023-11-05 11:01:27 +00:00
|
|
|
- name: Install Helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-11-12 23:14:46 +00:00
|
|
|
version: v3.13.2
|
2022-04-05 17:30:02 +00:00
|
|
|
|
2023-12-06 18:23:29 +00:00
|
|
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-30 10:54:44 +00:00
|
|
|
python-version: "3.11"
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Set up chart-testing
|
2023-11-03 14:27:24 +00:00
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Create k3d cluster
|
|
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
|
|
with:
|
2023-11-05 11:01:27 +00:00
|
|
|
version: latest
|
2023-01-15 17:25:23 +00:00
|
|
|
# Flags found here https://github.com/k3d-io/k3d
|
|
|
|
k3d-args: --k3s-arg --disable=metrics-server@server:*
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Remove node taints
|
|
|
|
run: |
|
|
|
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
|
|
|
|
2023-06-07 10:44:38 +00:00
|
|
|
- name: Add Dependencies
|
|
|
|
run: |
|
2023-07-31 10:32:04 +00:00
|
|
|
if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait
|
|
|
|
fi
|
|
|
|
## TODO: Only add when required
|
|
|
|
if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then
|
|
|
|
helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
2023-06-09 07:25:15 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait
|
2023-06-09 07:25:15 +00:00
|
|
|
fi
|
2023-10-07 23:16:09 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/enterprise/traefik" ]]; then
|
|
|
|
helm install traefik truecharts/traefik --namespace traefik --create-namespace --wait
|
|
|
|
fi
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Run chart-testing (install)
|
2023-06-07 10:44:38 +00:00
|
|
|
run: ct install --config ".github/ct-install.yaml" --charts "${{ matrix.chart }}" # --upgrade
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
install-charts5:
|
|
|
|
needs:
|
|
|
|
- generate-install-matrix
|
|
|
|
if: needs.generate-install-matrix.outputs.detected5 == 'true'
|
|
|
|
name: Install charts Part 5
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix5) }}
|
|
|
|
fail-fast: false
|
2022-08-08 19:17:50 +00:00
|
|
|
max-parallel: 10
|
2022-04-05 17:30:02 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-17 17:24:19 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-28 17:28:55 +00:00
|
|
|
fetch-depth: 1
|
2022-04-05 17:30:02 +00:00
|
|
|
ref: ${{ inputs.checkoutCommit }}
|
|
|
|
|
2023-11-05 11:01:27 +00:00
|
|
|
- name: Install Helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-11-12 23:14:46 +00:00
|
|
|
version: v3.13.2
|
2022-04-05 17:30:02 +00:00
|
|
|
|
2023-12-06 18:23:29 +00:00
|
|
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-30 10:54:44 +00:00
|
|
|
python-version: "3.11"
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Set up chart-testing
|
2023-11-03 14:27:24 +00:00
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Create k3d cluster
|
|
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
|
|
with:
|
2023-11-05 11:01:27 +00:00
|
|
|
version: latest
|
2023-01-15 17:25:23 +00:00
|
|
|
# Flags found here https://github.com/k3d-io/k3d
|
|
|
|
k3d-args: --k3s-arg --disable=metrics-server@server:*
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Remove node taints
|
|
|
|
run: |
|
|
|
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
|
|
|
|
2023-06-07 10:44:38 +00:00
|
|
|
- name: Add Dependencies
|
|
|
|
run: |
|
2023-07-31 10:32:04 +00:00
|
|
|
if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait
|
|
|
|
fi
|
|
|
|
## TODO: Only add when required
|
|
|
|
if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then
|
|
|
|
helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
2023-06-09 07:25:15 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait
|
2023-06-09 07:25:15 +00:00
|
|
|
fi
|
2023-10-07 23:16:09 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/enterprise/traefik" ]]; then
|
|
|
|
helm install traefik truecharts/traefik --namespace traefik --create-namespace --wait
|
|
|
|
fi
|
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Run chart-testing (install)
|
2023-06-07 10:44:38 +00:00
|
|
|
run: ct install --config ".github/ct-install.yaml" --charts "${{ matrix.chart }}" # --upgrade
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
install-charts6:
|
|
|
|
needs:
|
|
|
|
- generate-install-matrix
|
|
|
|
if: needs.generate-install-matrix.outputs.detected6 == 'true'
|
|
|
|
name: Install charts Part 6
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJson(needs.generate-install-matrix.outputs.matrix6) }}
|
|
|
|
fail-fast: false
|
2022-08-08 19:17:50 +00:00
|
|
|
max-parallel: 10
|
2022-04-05 17:30:02 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-17 17:24:19 +00:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-28 17:28:55 +00:00
|
|
|
fetch-depth: 1
|
2022-04-05 17:30:02 +00:00
|
|
|
ref: ${{ inputs.checkoutCommit }}
|
|
|
|
|
2023-11-05 11:01:27 +00:00
|
|
|
- name: Install Helm
|
|
|
|
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-11-12 23:14:46 +00:00
|
|
|
version: v3.13.2
|
2022-04-05 17:30:02 +00:00
|
|
|
|
2023-12-06 18:23:29 +00:00
|
|
|
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
|
2022-04-05 17:30:02 +00:00
|
|
|
with:
|
2023-05-30 10:54:44 +00:00
|
|
|
python-version: "3.11"
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Set up chart-testing
|
2023-11-03 14:27:24 +00:00
|
|
|
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
|
2022-04-05 17:30:02 +00:00
|
|
|
|
|
|
|
- name: Create k3d cluster
|
|
|
|
uses: nolar/setup-k3d-k3s@v1
|
|
|
|
with:
|
2023-11-05 11:01:27 +00:00
|
|
|
version: latest
|
2023-01-15 17:25:23 +00:00
|
|
|
# Flags found here https://github.com/k3d-io/k3d
|
|
|
|
k3d-args: --k3s-arg --disable=metrics-server@server:*
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Remove node taints
|
|
|
|
run: |
|
|
|
|
kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true
|
|
|
|
|
2023-06-07 10:44:38 +00:00
|
|
|
- name: Add Dependencies
|
|
|
|
run: |
|
2023-07-31 10:32:04 +00:00
|
|
|
if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait
|
|
|
|
fi
|
|
|
|
## TODO: Only add when required
|
|
|
|
if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then
|
|
|
|
helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait
|
2023-06-07 10:44:38 +00:00
|
|
|
fi
|
2023-06-09 07:25:15 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then
|
2023-07-31 17:34:55 +00:00
|
|
|
helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait
|
2023-06-09 07:25:15 +00:00
|
|
|
fi
|
2023-10-07 23:16:09 +00:00
|
|
|
if [[ "${{ matrix.chart }}" != "charts/enterprise/traefik" ]]; then
|
|
|
|
helm install traefik truecharts/traefik --namespace traefik --create-namespace --wait
|
|
|
|
fi
|
2023-06-07 10:44:38 +00:00
|
|
|
|
2022-04-05 17:30:02 +00:00
|
|
|
- name: Run chart-testing (install)
|
2023-06-07 10:44:38 +00:00
|
|
|
run: ct install --config ".github/ct-install.yaml" --charts "${{ matrix.chart }}" # --upgrade
|
2022-04-05 17:30:02 +00:00
|
|
|
|
2023-01-09 16:20:37 +00:00
|
|
|
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
|
|
|
|
install_success:
|
|
|
|
needs:
|
|
|
|
- generate-install-matrix
|
|
|
|
- install-charts1
|
|
|
|
- install-charts2
|
|
|
|
- install-charts3
|
|
|
|
- install-charts4
|
|
|
|
- install-charts5
|
|
|
|
- install-charts6
|
|
|
|
if: ${{ always() }}
|
|
|
|
name: Install successful
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check install matrix status
|
|
|
|
run: |
|
2023-01-09 15:44:38 +00:00
|
|
|
res1="${{needs.install-charts1.result}}"
|
|
|
|
res2="${{needs.install-charts2.result}}"
|
|
|
|
res3="${{needs.install-charts3.result}}"
|
|
|
|
res4="${{needs.install-charts4.result}}"
|
|
|
|
res5="${{needs.install-charts5.result}}"
|
|
|
|
res6="${{needs.install-charts6.result}}"
|
2023-01-17 23:06:10 +00:00
|
|
|
|
2023-01-09 15:44:38 +00:00
|
|
|
if [[ $res1 == "success" || $res1 == "skipped" ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [1] was successful..."
|
2023-01-09 15:44:38 +00:00
|
|
|
else
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [1] failed, stopping..."
|
2023-01-09 15:44:38 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-01-17 23:06:10 +00:00
|
|
|
|
2023-01-09 15:44:38 +00:00
|
|
|
if [[ $res2 == "success" || $res2 == "skipped" ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [2] was successful..."
|
2023-01-09 15:44:38 +00:00
|
|
|
else
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [2] failed, stopping..."
|
2023-01-09 15:44:38 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-01-17 23:06:10 +00:00
|
|
|
|
2023-01-09 15:44:38 +00:00
|
|
|
if [[ $res3 == "success" || $res3 == "skipped" ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [3] was successful..."
|
2023-01-09 15:44:38 +00:00
|
|
|
else
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [3] failed, stopping..."
|
2023-01-09 15:44:38 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-01-17 23:06:10 +00:00
|
|
|
|
2023-01-09 15:44:38 +00:00
|
|
|
if [[ $res4 == "success" || $res4 == "skipped" ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [4] was successful..."
|
2023-01-09 15:44:38 +00:00
|
|
|
else
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [4] failed, stopping..."
|
2023-01-09 15:44:38 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-01-17 23:06:10 +00:00
|
|
|
|
2023-01-09 15:44:38 +00:00
|
|
|
if [[ $res5 == "success" || $res5 == "skipped" ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [5] was successful..."
|
2023-01-09 15:44:38 +00:00
|
|
|
else
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [5] failed, stopping..."
|
2023-01-09 15:44:38 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2023-01-17 23:06:10 +00:00
|
|
|
|
2023-01-09 15:44:38 +00:00
|
|
|
if [[ $res6 == "success" || $res6 == "skipped" ]]; then
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [6] was successful..."
|
2023-01-09 15:44:38 +00:00
|
|
|
else
|
2023-05-30 10:54:44 +00:00
|
|
|
echo "Install test suite [6] failed, stopping..."
|
2023-01-09 15:44:38 +00:00
|
|
|
exit 1
|
|
|
|
fi
|