diff --git a/.mdlrc b/.github/config/markdownlint.yaml similarity index 100% rename from .mdlrc rename to .github/config/markdownlint.yaml diff --git a/.github/workflows/chart-linting.yml b/.github/workflows/chart-linting.yml new file mode 100644 index 00000000..71ebca0c --- /dev/null +++ b/.github/workflows/chart-linting.yml @@ -0,0 +1,78 @@ +name: Chart-Linting + +on: + pull_request: + branches: [main] + paths: ["charts/**"] + push: + branches: [main] + paths: ["charts/**"] + workflow_dispatch: + +jobs: + + artifacthub-lint: + runs-on: ubuntu-latest + container: + image: artifacthub/ah + options: --user 1001 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Run ah lint + working-directory: ./charts + run: ah lint + + ct-lint: + runs-on: ubuntu-22.04 + steps: + - name: checkout git repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: setup helm + uses: azure/setup-helm@v3 + + - uses: actions/setup-python@v5 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --config .github/config/chart-testing.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: ct lint --config .github/config/chart-testing.yaml + + helm-lint: + runs-on: ubuntu-22.04 + steps: + - name: checkout git repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: setup helm + uses: azure/setup-helm@v3 + + - uses: actions/setup-python@v5 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.6.1 + + - name: helm dependency update on changed charts + run : ct list-changed --config .github/config/chart-testing.yaml | xargs -d '\n' -I {} helm dependency update {} + + - name: helm lint on changed charts + run : ct list-changed --config .github/config/chart-testing.yaml | xargs -d '\n' -I {} helm lint {} diff --git a/.github/workflows/chart-testing.yml b/.github/workflows/chart-testing.yml index 97937df5..dd0b09bb 100644 --- a/.github/workflows/chart-testing.yml +++ b/.github/workflows/chart-testing.yml @@ -9,47 +9,13 @@ on: branches: [main] paths: ["charts/**"] workflow_dispatch: + workflow_run: + workflows: ["Chart-Linting"] + types: ["completed"] jobs: - artifacthub-lint: - runs-on: ubuntu-latest - container: - image: artifacthub/ah - options: --user 1001 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Run ah lint - working-directory: ./charts - run: ah lint - - helm-lint: - runs-on: ubuntu-22.04 - steps: - - name: checkout git repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: setup helm - uses: azure/setup-helm@v3 - - - uses: actions/setup-python@v5 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.6.1 - - - name: helm dependency update on changed charts - run : ct list-changed --config .github/config/chart-testing.yaml | xargs -d '\n' -I {} helm dependency update {} - - - name: helm lint on changed charts - run : ct list-changed --config .github/config/chart-testing.yaml | xargs -d '\n' -I {} helm lint {} - - chart-testing: + installation: runs-on: ubuntu-22.04 steps: - name: checkout git repository @@ -75,12 +41,10 @@ jobs: echo "::set-output name=changed::true" fi - - name: Run chart-testing (lint) - run: ct lint --config .github/config/chart-testing.yaml - - name: Create kind cluster uses: helm/kind-action@v1.10.0 if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) run: ct install --config .github/config/chart-testing.yaml + if: steps.list-changed.outputs.changed == 'true' diff --git a/.kube-linter.yaml b/.kube-linter.yaml deleted file mode 100644 index debd42c8..00000000 --- a/.kube-linter.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# customChecks defines custom checks. -checks: - exclude: - - "unset-cpu-requirements" - - "unset-memory-requirements" - - "no-read-only-root-fs" diff --git a/.polaris.yaml b/.polaris.yaml deleted file mode 100644 index 0ed07ffc..00000000 --- a/.polaris.yaml +++ /dev/null @@ -1,23 +0,0 @@ -checks: - cpuRequestsMissing: ignore - cpuLimitsMissing: ignore - memoryRequestsMissing: ignore - memoryLimitsMissing: ignore - # images - tagNotSpecified: danger - pullPolicyNotAlways: ignore - # healthChecks - readinessProbeMissing: warning - livenessProbeMissing: warning - # networking - hostNetworkSet: warning - hostPortSet: warning - # security - hostIPCSet: danger - hostPIDSet: danger - notReadOnlyRootFilesystem: warning - privilegeEscalationAllowed: danger - runAsRootAllowed: warning - runAsPrivileged: danger - dangerousCapabilities: danger - insecureCapabilities: warning diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e98b2ef3..527d7991 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,14 +22,8 @@ repos: args: - --chart-search-root=charts - # - repo: https://github.com/igorshubovych/markdownlint-cli - # rev: v0.32.2 - # hooks: - # - id: markdownlint - # name: Markdownlint - - # - repo: https://github.com/jumanjihouse/pre-commit-hooks - # rev: 3.0.0 - # hooks: - # - id: shellcheck - # name: Shellcheck + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.32.2 + hooks: + - id: markdownlint + name: Markdownlint diff --git a/.yamllint b/.yamllint deleted file mode 100644 index efa8e6c6..00000000 --- a/.yamllint +++ /dev/null @@ -1,8 +0,0 @@ -extends: default - -rules: - line-length: disable - document-start: enable - -ignore: | - charts/**/templates