Skip to content

Commit

Permalink
ci: init gh-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mriedmann committed May 15, 2024
1 parent 8cc54ef commit 6530644
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/helm-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Helm CI

on:
push:
branches:
- main
paths:
- .github/workflows/**
- charts/**
pull_request:
branches:
- main
paths:
- .github/workflows/**
- charts/**

permissions: { }

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
security-events: write
steps:
- name: Checkout Repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # tag=v4.1.5
with:
fetch-depth: "0"
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # tag=v4.2.0
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # tag=v5.1.0
with:
python-version: "3.11"
check-latest: true
- name: Set up Chart Testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # tag=v2.6.1
- name: Lint Chart
run: ct lint --config ct.yaml
- name: Scan for Misconfiguration
uses: aquasecurity/trivy-action@b2933f565dbc598b29947660e66259e3c7bc8561 # tag=v0.20.0
with:
scan-type: config
format: sarif
output: misconfig.sarif
- name: Upload Misconfiguration Scan Results
uses: github/codeql-action/upload-sarif@956f09c2ef1926b580554b9014cfb8a51abf89dd # tag=codeql-bundle-v2.16.6
with:
sarif_file: misconfig.sarif

test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # tag=v4.1.5
with:
fetch-depth: "0"
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # tag=v4.2.0
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # tag=v5.1.0
with:
python-version: "3.11"
check-latest: true
- name: Set up Chart Testing
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # tag=v2.6.1
- name: Create Kind Cluster
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # tag=v1.10.0
- name: Test
run: ct install --config ct.yaml --debug
44 changes: 44 additions & 0 deletions .github/workflows/helm-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Helm Docs

on:
push:
branches:
- main
paths:
- .github/workflows/**
- charts/**
workflow_dispatch: { }

permissions: { }

jobs:
update-docs:
name: Update Docs
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # tag=v4.1.5
- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # tag=v5.0.1
with:
go-version: "1.22"
check-latest: true
- name: Install helm-docs
run: go install -v github.com/norwoodj/helm-docs/cmd/[email protected]
- name: Run helm-docs
run: helm-docs
- name: Create Pull Request
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # tag=v6.0.5
with:
add-paths: "charts/*/README.md"
branch: update-helm-docs
body: "Updates Helm chart documentation using [helm-docs](https://github.com/norwoodj/helm-docs)"
commit-message: Update helm docs
delete-branch: true
labels: documentation
signoff: true
title: Update helm docs
31 changes: 31 additions & 0 deletions .github/workflows/helm-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Helm Release

on:
workflow_dispatch: { }

permissions: { }

jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # tag=v4.1.5
with:
fetch-depth: "0"
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Set up Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # tag=v4.2.0
- name: Release Chart
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # tag=v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
config: cr.yaml
2 changes: 2 additions & 0 deletions cr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
generate-release-notes: true
skip-existing: true
2 changes: 2 additions & 0 deletions ct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target-branch: main
helm-extra-args: --timeout 60s

0 comments on commit 6530644

Please sign in to comment.