Skip to content

update: scripts

update: scripts #489

name: Validate Manifests
on: # yamllint disable-line rule:truthy
push:
branches:
- "main"
paths-ignore:
- README.md
- docs/*.md
pull_request:
branches:
- "main"
paths-ignore:
- README.md
- docs/*.md
jobs:
lint-kustomize:
runs-on: ubuntu-latest
# env:
# KUSTOMIZE_URL: "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.0.0/kustomize_v5.0.0_linux_amd64.tar.gz"
# BIN_PATH: /usr/local/bin
steps:
# Kustomize now comes pre-installed on the "ubuntu-latest" image, no need for manual installation
#
# - name: Install Kustomize
# run: |
# echo "Downloading Kustomize from URL: ${KUSTOMIZE_URL} and saving into ${BIN_PATH}/"
# sudo curl --location --no-buffer "${KUSTOMIZE_URL}" | tar -xvz -C "${BIN_PATH}/"
# sudo chmod +x ${BIN_PATH}/kustomize
#
- name: Code Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Verify Kustomize CLI Installation
run: |
which kustomize
kustomize version
- name: Validate Manifests
run: |
[ -d ./bootstrap/base ] && touch bootstrap/base/sealed-secrets-secret.yaml
./scripts/validate_manifests.sh
lint-yaml:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Validate YAML
uses: ibiqlik/action-yamllint@v3
lint-bash:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
version: v0.8.0
severity: warning
# lint-container:
# runs-on: ubuntu-latest
# steps:
# - name: Code Checkout
# uses: actions/checkout@v4
# - name: Run hadolint
# uses: hadolint/[email protected]
# with:
# dockerfile: Containerfile
# recursive: true
# - name: Run hadolint
# uses: hadolint/[email protected]
# with:
# dockerfile: Dockerfile
# recursive: true
lint-manifests:
runs-on: ubuntu-latest
env:
# KUSTOMIZE_VERSION: v5.0.1
BIN_PATH: /usr/bin
steps:
- name: Install Kustomize
run: |
set -x
LATEST=$( curl -s https://api.github.com/repos/kubernetes-sigs/kustomize/releases/latest | jq .name | sed 's#kustomize/##; s#"##g')
BIN_VERSION=${KUSTOMIZE_VERSION:-${LATEST}}
DOWNLOAD_URL=https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${BIN_VERSION}/kustomize_${BIN_VERSION}_linux_amd64.tar.gz
curl "${DOWNLOAD_URL}" -sL | sudo tar zx -C "${BIN_PATH}/" kustomize
sudo chmod +x "${BIN_PATH}"/kustomize
- name: Code Checkout
uses: actions/checkout@v4
- name: Validate Manifests
run: |
[ -d ./bootstrap/base ] && touch bootstrap/base/sealed-secrets-secret.yaml
./scripts/validate_kustomize.sh
./scripts/validate_helm.sh