mirror of
https://github.com/helm/chart-testing.git
synced 2026-02-05 09:45:14 +01:00
* add job to check if docs are up to date Signed-off-by: cpanato <ctadeu@gmail.com> * remove auto generated date Signed-off-by: cpanato <ctadeu@gmail.com> * disable auto generated tag in the docs Signed-off-by: cpanato <ctadeu@gmail.com> Signed-off-by: cpanato <ctadeu@gmail.com>
115 lines
3.2 KiB
YAML
115 lines
3.2 KiB
YAML
name: ci
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: checkout
|
|
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: shellcheck
|
|
uses: ludeeus/action-shellcheck@94e0aab03ca135d11a35e5bfc14e6746dc56e7e9 # v1.1.0
|
|
|
|
- name: Setup go
|
|
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.3.0
|
|
with:
|
|
go-version-file: './go.mod'
|
|
check-latest: true
|
|
|
|
- uses: azure/setup-helm@b5b231a831f96336bbfeccc1329990f0005c5bb1 # v3.3
|
|
with:
|
|
version: v3.9.4
|
|
|
|
- name: Install GoReleaser
|
|
uses: goreleaser/goreleaser-action@ff11ca24a9b39f2d36796d1fbd7a4e39c182630a # v3.1.0
|
|
with:
|
|
install-only: true
|
|
|
|
- name: Install cosign
|
|
uses: sigstore/cosign-installer@f3c664df7af409cb4873aa5068053ba9d61a57b6 # v2.6.0
|
|
|
|
- name: Install syft
|
|
uses: anchore/sbom-action/download-syft@b5042e9d19d8b32849779bfe17673ff84aec702d # v0.12.0
|
|
|
|
- name: Install k8s Kind
|
|
uses: helm/kind-action@d08cf6ff1575077dee99962540d77ce91c62387d # v1.3.0
|
|
with:
|
|
install_only: true
|
|
|
|
- name: Install tools
|
|
run: |
|
|
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
|
|
chmod +x ./kubectl
|
|
sudo mv ./kubectl /usr/local/bin/kubectl
|
|
|
|
./setup.sh
|
|
|
|
- name: Test
|
|
run: |
|
|
./e2e-kind.sh
|
|
|
|
- name: Lint
|
|
run: |
|
|
go vet -v ./...
|
|
goimports -w -l .
|
|
go mod tidy
|
|
git diff --exit-code
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 # v2.0.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v2.0.0
|
|
|
|
- name: Build
|
|
run: |
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
echo "Building snapshot..."
|
|
./build.sh
|
|
|
|
check-docs:
|
|
name: check-docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3
|
|
- uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # v3
|
|
with:
|
|
go-version-file: './go.mod'
|
|
check-latest: true
|
|
|
|
- name: generate docs
|
|
run: |
|
|
go build -o ct-bin ./ct/main.go
|
|
./ct-bin doc-gen
|
|
git_status="$(git status --porcelain)"
|
|
if [[ ${git_status} ]]; then
|
|
echo -e 'Documentation is outdated. Please update the docs\n'
|
|
echo "${git_status}"
|
|
exit 1
|
|
fi
|
|
|
|
golangci:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3
|
|
- uses: actions/setup-go@84cbf8094393cdc5fe1fe1671ff2647332956b1a # v3
|
|
with:
|
|
go-version-file: './go.mod'
|
|
check-latest: true
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # v3
|
|
with:
|
|
version: v1.48.0
|