Skip to content

Lint and Test Charts #20

Lint and Test Charts

Lint and Test Charts #20

name: Lint and Test Charts
on:
schedule:
- cron: "0 0 * * *" # Every day at 00:00
push:
branches:
- "main"
pull_request:
branches: "*"
paths-ignore:
- LICENSE
- '*.md'
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: false
- name: Checkout
uses: actions/checkout@v3
- name: Helm Installation
uses: azure/setup-helm@v3
- uses: actions/setup-python@main
with:
check-latest: true
cache: 'pip' # caching pip dependencies
- name: Install helm chart testing
uses: helm/chart-testing-action@main
- name: Run chart-testing (lint)
run: ct lint --validate-maintainers=false --chart-dirs . --charts mviewer --target-branch ${{ github.event.repository.default_branch }}
- name: Validate the Kubernetes manifest with yannh/kubeconform
run: |
helm plugin install https://github.com/jtyr/kubeconform-helm
sudo pip install pyyaml
helm kubeconform --values-dir mviewer/ci --summary mviewer
- name: k3s install + add more swap
run: |
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -
sudo dd if=/dev/zero of=/swapfile bs=1M count=4k status=progress
sudo chmod 0600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h
until KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl get --raw='/readyz?verbose'; do echo "wait for k3s to finish"; done
KUBECONFIG=/etc/rancher/k3s/k3s.yaml kubectl taint nodes -l kubernetes.io/os=linux key1=value1:NoSchedule
- name: Run chart-testing (install)
run: |
KUBECONFIG=/etc/rancher/k3s/k3s.yaml ct install --chart-dirs . --charts mviewer --helm-extra-args '--timeout 1800s' --target-branch ${{ github.event.repository.default_branch }}