Skip to content

fix(ci): regenerate helm/README.md and auto-regen on release-please PRs #17

fix(ci): regenerate helm/README.md and auto-regen on release-please PRs

fix(ci): regenerate helm/README.md and auto-regen on release-please PRs #17

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.1
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Run tests with race detector and coverage
run: |
go test -race \
-coverpkg=./... \
-coverprofile=coverage.out \
-timeout 5m \
./...
- name: Upload coverage artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.out
retention-days: 7
coverage-badge:
name: Coverage badge
needs: test
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Download coverage
uses: actions/download-artifact@v4
with:
name: coverage
- name: Extract coverage percentage
id: coverage
run: |
PCT=$(go tool cover -func=coverage.out | grep total | awk '{print $3}' | tr -d '%')
echo "percentage=${PCT}" >> "$GITHUB_OUTPUT"
- name: Update coverage badge gist
uses: schneegans/dynamic-badges-action@v1.8.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: ${{ vars.COVERAGE_GIST_ID }}
filename: vault-db-injector-coverage.json
label: coverage
message: ${{ steps.coverage.outputs.percentage }}%
valColorRange: ${{ steps.coverage.outputs.percentage }}
minColorRange: 40
maxColorRange: 80
govulncheck:
name: govulncheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run govulncheck
uses: golang/govulncheck-action@v1
with:
go-version-file: go.mod
cache: true
helm-lint:
name: Helm lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: azure/setup-helm@v4
with:
version: v3.16.4
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.8.0
- name: Run chart-testing lint
run: ct lint --charts helm --validate-maintainers=false
- name: Render templates with default values
run: helm template test-render helm/ > /dev/null
helm-docs-check:
name: helm-docs sync
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install helm-docs
run: |
HELM_DOCS_VERSION=1.14.2
curl -fsSL "https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_Linux_x86_64.deb" -o /tmp/helm-docs.deb
sudo dpkg -i /tmp/helm-docs.deb
- name: Verify helm/README.md is in sync
run: make helm-docs-check
docs-build-strict:
name: mkdocs strict build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install hatch
run: pip install --upgrade hatch
- name: Build docs (strict mode)
run: hatch -e docs run mkdocs build --strict
pr-title:
name: Conventional PR title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
chore
docs
perf
refactor
test
build
ci
style