Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Run ct install and extend contributors docs #4

Merged
merged 10 commits into from
May 31, 2024
23 changes: 14 additions & 9 deletions .github/workflows/chart-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
runs-on: ubuntu-latest
env:
CT_TARGET_BRANCH: ${{ github.event.repository.default_branch }}
CT_CHART_DIRS: charts
CT_GITHUB_GROUPS: "true"
CT_USE_HELMIGNORE: "true"
steps:
Expand All @@ -32,6 +31,18 @@ jobs:
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44.5.2
with:
files: |
charts/**

# Force ct to run on workflows triggered by dependabot updates
- name: Set CT_ALL
if: steps.changed-files.outputs.any_changed != 'true'
run: echo CT_ALL=true >> $GITHUB_ENV

- name: Run chart-testing (lint)
run: ct lint

Expand Down Expand Up @@ -62,14 +73,8 @@ jobs:
run: |
kubectl apply -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml

# TODO(avorima): Install chart using ct once packages are available
- name: Install helm chart (dry-run)
run: >
helm show crds $CHART | kubectl apply -f -;
helm install ionoscloud-blockstorage-csi-driver $CHART -n kube-system -n kube-system -f $CHART/ci/ct-values.yaml --dry-run -o json | jq -r '.manifest' |
kubectl apply --dry-run=server --validate=true -f -
env:
CHART: ./charts/ionoscloud-blockstorage-csi-driver
- name: Run chart-testing (install)
run: ct install --namespace kube-system --upgrade


helm-docs-validate:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- main
paths:
- 'charts/**/Chart.yaml'
pull_request:
paths:
- .github/workflows/chart-release.yml
- ./hack/publish-chart.sh

permissions:
contents: write
Expand Down Expand Up @@ -35,4 +39,9 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish chart to GitHub Container Registry
if: github.event_name != 'pull_request'
run: ./hack/publish-chart.sh

- name: Publish chart to GitHub Container Registry (dry-run)
if: github.event_name == 'pull_request'
run: DRY_RUN=1 ./hack/publish-chart.sh
gfariasalves-ionos marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 18 additions & 0 deletions .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint docs

on:
pull_request:
paths:
- '**.md'
- .github/workflows/lint-docs.yml

jobs:
markdown-link-check:
name: Check links
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.4

- name: Run link checker
uses: gaurav-nelson/github-action-markdown-link-check@1.0.15
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: helmlint
files: ^charts/

- repo: https://github.com/norwoodj/helm-docs
rev: v1.13.1
hooks:
- id: helm-docs
files: (README\.md\.gotmpl|(Chart|values)\.yaml)$

- repo: https://github.com/tcort/markdown-link-check
rev: v3.12.2
hooks:
- id: markdown-link-check
args: [-q]
23 changes: 9 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ community looks forward to your contributions. 🎉
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Improving The Documentation](#improving-the-documentation)
- [Styleguides](#styleguides)
- [Commit Messages](#commit-messages)
- [Join The Project Team](#join-the-project-team)

- [Pull requests](#pull-requests)


## I Have a Question
Expand Down Expand Up @@ -128,18 +125,14 @@ Enhancement suggestions are tracked as

### Your First Code Contribution

<!-- TODO -->

### Improving The Documentation
Is is recommended that you install [pre-commit](https://pre-commit.com/) hooks as a first step:

This project uses [helm-docs](https://github.com/norwoodj/helm-docs) to generate helm chart documentation from a template.
Make sure to re-generate the docs after you've updated the
[template](./charts/ionoscloud-blockstorage-csi-driver/README.gotmpl),
[values](./charts/ionoscloud-blockstorage-csi-driver/values) or
[Chart.yaml](./charts/ionoscloud-blockstorage-csi-driver/Chart.yaml).
```
pre-commit install
```

It is recommended that you install a
[pre-commit hook](https://github.com/norwoodj/helm-docs/blob/master/README.md#pre-commit-hook) to automate this.
The hooks are set up to perform basic validations on your code, like fixing newlines at the end of a file or linting
changed helm files.

## Styleguides

Expand All @@ -151,5 +144,7 @@ Ensure that they follow the [convention commit](https://www.conventionalcommits.
The pull request title will correspond to the first line in the commit message, with the description populating the
rest.

Single commits in a pull request do not need to adhere to this.

## Attribution
This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

Container Storage Interface (CSI) plugin for IONOS Cloud [block storage][1].

The repository currently only contains the Helm chart.
The actual driver will be open sourced later.

## Features

* **Static Provisioning**: Associate an externally-created volume with a [Persistent Volume][2] (PV) for consumption
Expand All @@ -25,7 +28,7 @@ Configurable storage class parameters:

## Contributing

See [CONTRIBUTING.md] for more information.
See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.

[1]: https://cloud.ionos.com/storage/block-storage
[2]: https://kubernetes.io/docs/concepts/storage/persistent-volumes
Expand Down