From 52e4516e0418ead3eb052e70b1bd77dad3c4437d Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 10:48:45 +0100 Subject: [PATCH 1/2] Add CI install step Signed-off-by: Michel Hollands --- .github/configs/cluster-config.yaml | 19 ++++++++ .github/workflows/helm-ci.yml | 76 ++++++++++++++--------------- 2 files changed, 57 insertions(+), 38 deletions(-) create mode 100644 .github/configs/cluster-config.yaml diff --git a/.github/configs/cluster-config.yaml b/.github/configs/cluster-config.yaml new file mode 100644 index 0000000..904c17c --- /dev/null +++ b/.github/configs/cluster-config.yaml @@ -0,0 +1,19 @@ +apiVersion: kind.x-k8s.io/v1alpha4 +kind: Cluster +nodes: + - role: control-plane + kubeadmConfigPatches: + - | + kind: ClusterConfiguration + controllerManager: + extraArgs: + bind-address: 0.0.0.0 + secure-port: "10257" + scheduler: + extraArgs: + bind-address: 0.0.0.0 + secure-port: "10259" + - | + kind: KubeProxyConfiguration + metricsBindAddress: 0.0.0.0:10249 + - role: worker \ No newline at end of file diff --git a/.github/workflows/helm-ci.yml b/.github/workflows/helm-ci.yml index bc970a1..3e5ca31 100644 --- a/.github/workflows/helm-ci.yml +++ b/.github/workflows/helm-ci.yml @@ -19,48 +19,48 @@ jobs: - name: Lint Yaml run: make helm-lint - # call-test: - # name: Test Helm Chart - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # with: - # fetch-depth: 0 + call-test: + name: Test Helm Chart + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 - # - name: Set up Helm - # uses: azure/setup-helm@v3 - # with: - # version: v3.8.2 + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.8.2 - # # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and - # # yamllint (https://github.com/adrienverge/yamllint) which require Python - # - name: Set up Python - # uses: actions/setup-python@v4 - # with: - # python-version: 3.7 + # Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and + # yamllint (https://github.com/adrienverge/yamllint) which require Python + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 - # - name: Set up chart-testing - # uses: helm/chart-testing-action@v2.4.0 + - name: Set up chart-testing + uses: helm/chart-testing-action@v2 - # - name: Run chart-testing (list-changed) - # id: list-changed - # run: | - # changed=$(ct list-changed --config "${CT_CONFIGFILE}") - # if [[ -n "$changed" ]]; then - # echo "changed=true" >> $GITHUB_OUTPUT - # fi + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config "${CT_CONFIGFILE}") + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + fi - # - name: Run chart-testing (lint) - # run: ct lint --config "${CT_CONFIGFILE}" --check-version-increment=false + - name: Run chart-testing (lint) + run: ct lint --config "${CT_CONFIGFILE}" --check-version-increment=false - # - name: Create kind cluster - # uses: helm/kind-action@v1.8.0 - # if: steps.list-changed.outputs.changed == 'true' - # with: - # config: tools/kind.config + - name: Create kind cluster + uses: helm/kind-action@v1 + if: steps.list-changed.outputs.changed == 'true' + with: + config: "${{ github.workspace }}/.github/configs/cluster-config.yaml" - # - name: Run chart-testing (install) - # run: | - # changed=$(ct list-changed --config "${CT_CONFIGFILE}") - # ct install --config "${CT_CONFIGFILE}" + - name: Run chart-testing (install) + run: | + changed=$(ct list-changed --config "${CT_CONFIGFILE}") + ct install --config "${CT_CONFIGFILE}" From 2a681ce1eb15d250290a02241aff7ca0fb927959 Mon Sep 17 00:00:00 2001 From: Michel Hollands Date: Tue, 14 May 2024 10:50:12 +0100 Subject: [PATCH 2/2] Add workflow dispatch Signed-off-by: Michel Hollands --- .github/workflows/helm-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/helm-ci.yml b/.github/workflows/helm-ci.yml index 3e5ca31..69b9f68 100644 --- a/.github/workflows/helm-ci.yml +++ b/.github/workflows/helm-ci.yml @@ -1,6 +1,7 @@ --- name: helm-ci on: + workflow_dispatch: pull_request: paths: - "charts/meta-monitoring/**"