Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/configs/ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
check-version-increment: false
validate-maintainers: false
26 changes: 26 additions & 0 deletions .github/configs/lintconf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
rules:
braces:
level: error
brackets:
level: error
colons:
level: error
commas:
level: error
comments:
level: error
document-end: disable
document-start: disable # No --- to start a file
hyphens:
level: warning
indentation:
level: warning
key-duplicates: enable
line-length: disable # Lines can be any length
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: enable
truthy:
level: warning
60 changes: 60 additions & 0 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Lint and Test Charts

on:
workflow_call:
inputs:
chartDirs:
description: "The root dir or dirs (separated with commas)"
type: string
required: false
default: "."

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout Shared Workflows repository
uses: actions/checkout@v4
with:
repository: MapColonies/shared-workflows
path: shared-workflows
token: ${{ secrets.GH_PAT }}

- name: Set up Helm
uses: azure/setup-helm@v4.2.0
with:
version: v3.16.3

- uses: actions/setup-python@v5
with:
python-version: '3.x'
check-latest: true

- 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 --chart-dirs ${{ inputs.chartDirs }} --target-branch ${{ github.event.repository.default_branch }} --config shared-workflows/.github/configs/ct.yaml)
echo "changed=$changed"
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --chart-dirs ${{ inputs.chartDirs }} --target-branch ${{ github.event.repository.default_branch }} --config shared-workflows/.github/configs/ct.yaml --lint-conf shared-workflows/.github/configs/lintconf.yaml

- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/kind-action@v1.10.0

- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --chart-dirs ${{ inputs.chartDirs }} --target-branch ${{ github.event.repository.default_branch }} --config shared-workflows/.github/configs/ct.yaml
17 changes: 17 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,25 @@ on:
type: boolean
required: false
default: false
enableHelmLint:
description: "Flag to enable helm lint"
type: boolean
required: false
default: true
chartDirs:
description: "The root dir or dirs (separated with commas)"
type: string
required: false
default: "."

jobs:
helm-lint:
if: ${{ inputs.enableHelmLint == true }}
uses: MapColonies/shared-workflows/.github/workflows/helm-lint.yaml@master
secrets: inherit
with:
chartDirs: ${{ inputs.chartDirs }}

eslint:
name: Run eslint
runs-on: ubuntu-latest
Expand Down