chore!: Rewrite Lint Workflow to Github (#685)

* feat: Move Linting to Github Actions

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

Disable ServiceAccount on disabled Dex

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

Swap Linting to Github

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

Increase all chart versions

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

Remove Circle & Improve Github Lint

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

Remove Circle & Improve Github Lint

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

Lookup Configmaps

update

Retest

Retest

reduce changes

reduce changes

* Bump argo-events

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* Move Config files

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* Readd Lint & Remove Argo Chart

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* Correct CT config name

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>

* Readd ARgo

Signed-off-by: Oliver Bähler <oliverbaehler@hotmail.com>
This commit is contained in:
Oliver Bähler 2021-05-21 15:03:28 +02:00 committed by GitHub
parent b971b36317
commit 35c754364f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 79 additions and 30 deletions

View file

@ -1,4 +0,0 @@
chart-repos:
- argo=https://argoproj.github.io/argo-helm
- minio=https://helm.min.io/
- dandydeveloper=https://dandydeveloper.github.io/charts/

View file

@ -5,8 +5,8 @@ jobs:
- image: quay.io/helmpack/chart-testing:v3.3.1 - image: quay.io/helmpack/chart-testing:v3.3.1
steps: steps:
- checkout - checkout
- run: helm repo add stable https://charts.helm.sh/stable - run: ct lint --config .github/ct.yaml --lint-conf .github/lintconf.yaml
- run: ct lint --config .circleci/chart-testing.yaml --lint-conf .circleci/lintconf.yaml
# Technically this only needs to be run on master, but it's good to have it run on every PR # Technically this only needs to be run on master, but it's good to have it run on every PR
# so that it is regularly tested. # so that it is regularly tested.
publish: publish:
@ -21,6 +21,7 @@ jobs:
- checkout - checkout
- run: helm repo add stable https://charts.helm.sh/stable - run: helm repo add stable https://charts.helm.sh/stable
- run: helm repo add minio https://helm.min.io/ - run: helm repo add minio https://helm.min.io/
- run: helm repo add argo https://argoproj.github.io/argo-helm
- run: helm repo add dandydeveloper https://dandydeveloper.github.io/charts/ - run: helm repo add dandydeveloper https://dandydeveloper.github.io/charts/
# Only actually publish charts on master. # Only actually publish charts on master.
- run: | - run: |
@ -38,4 +39,4 @@ workflows:
- lint - lint
- publish: - publish:
requires: requires:
- lint - lint

17
.github/ct.yaml vendored Normal file
View file

@ -0,0 +1,17 @@
## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md
# Don't add the 'debug' attribute, otherwise the workflow won't work anymore
remote: origin
chart-dirs:
- charts
chart-repos:
- argo=https://argoproj.github.io/argo-helm
- minio=https://helm.min.io/
- dandydeveloper=https://dandydeveloper.github.io/charts/
- stable=https://charts.helm.sh/stable
- incubator=https://charts.helm.sh/incubator
helm-extra-args: "--timeout 600s"
validate-chart-schema: false
validate-maintainers: true
validate-yaml: true
exclude-deprecated: true
excluded-charts: []

1
.github/stale.yml vendored
View file

@ -1 +0,0 @@
# See https://github.com/probot/stale

45
.github/workflows/lint-and-test.yml vendored Normal file
View file

@ -0,0 +1,45 @@
## Reference: https://github.com/helm/chart-testing-action
---
name: Linting and Testing
on: pull_request
jobs:
chart-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v1
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Setup Chart Linting
id: lint
uses: helm/chart-testing-action@v2.0.1
- name: List changed charts
id: list-changed
run: |
## If executed with debug this won't work anymore.
changed=$(ct --config ./.github/ct.yaml list-changed)
charts=$(echo "$changed" | tr '\n' ' ' | xargs)
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
echo "::set-output name=changed_charts::$charts"
fi
- name: Run chart-testing (lint)
run: ct lint --debug --config ./.github/ct.yaml --lint-conf ./.github/lintconf.yaml
- name: Create kind cluster
uses: helm/kind-action@v1.1.0
if: steps.list-changed.outputs.changed == 'true'
- name: Run chart-testing (install)
run: ct install --config ./.github/ct.yaml
if: steps.list-changed.outputs.changed == 'true'

View file

@ -1,14 +1,10 @@
name: Mark stale issues and pull requests name: Mark stale issues and pull requests
on: on:
schedule: schedule:
- cron: "30 1 * * *" - cron: "30 1 * * *"
jobs: jobs:
stale: stale:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/stale@v3 - uses: actions/stale@v3
with: with:

View file

@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
description: A Helm chart to install Argo-Events in k8s Cluster description: A Helm chart to install Argo-Events in k8s Cluster
name: argo-events name: argo-events
version: 1.4.0 version: 1.4.1
keywords: keywords:
- argo-events - argo-events
- sensor-controller - sensor-controller

View file

@ -1,6 +1,3 @@
serviceAccount: argo-events-sa-test serviceAccount: argo-events-sa-test
additionalSaNamespaces:
- nsone
- nstwo
instanceID: test-argo-events instanceID: test-argo-events
singleNamespace: false singleNamespace: false

View file

@ -1,19 +1,17 @@
#!/bin/bash #!/bin/bash
# This script runs the chart-testing tool locally. It simulates the linting that is also done by the github action. Run this without any errors before pushing.
# Reference: https://github.com/helm/chart-testing
set -eux set -eux
SRCROOT="$(cd "$(dirname "$0")/.." && pwd)" SRCROOT="$(cd "$(dirname "$0")/.." && pwd)"
for dir in $(find $SRCROOT/charts -mindepth 1 -maxdepth 1 -type d); echo -e "\n-- Linting all Helm Charts --\n"
do docker run \
rm -rf $dir/charts -v "$SRCROOT:/workdir" \
name=$(basename $dir) --entrypoint /bin/sh \
echo "Running Helm linting for $name" quay.io/helmpack/chart-testing:v3.3.1 \
docker run \ -c cd /workdir \
-v "$SRCROOT:/workdir" \ ct lint \
gcr.io/kubernetes-charts-ci/test-image:v3.1.0 \ --config .github/ct.yaml \
ct \ --lint-conf .github/lintconf.yaml \
lint \ --debug
--config .circleci/chart-testing.yaml \
--lint-conf .circleci/lintconf.yaml \
--charts "/workdir/charts/${name}"
done