Skip to content

Merge pull request #703 from drivebyer/fix-pvc #83

Merge pull request #703 from drivebyer/fix-pvc

Merge pull request #703 from drivebyer/fix-pvc #83

name: Validate Examples
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
validate-examples:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install yamllint
run: sudo apt-get install -y yamllint
- name: Lint YAML files
run: yamllint --strict ./example
- name: Install kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Create k8s Kind Cluster
uses: helm/[email protected]
with:
cluster_name: kind
- name: Apply CRD
run: |
for crd in $(find ./config/crd/bases -type f -name '*.yaml'); do
kubectl create -f $crd
done
- name: Validate CRD Installation
run: |
CRDs=("redis" "redissentinels" "redisclusters" "redisreplications")
for crd in "${CRDs[@]}"; do
kubectl get crd $crd.redis.redis.opstreelabs.in || exit 1
done
- name: Validate CR
run: |
for example in $(find ./example -type f -name '*.yaml'); do
kubectl apply --dry-run=server -f $example
done