Add ConfigMap/Secret, multi-container labs, diagnose script, exam not… #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate manifests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Validate YAML syntax | |
| run: | | |
| echo "Checking YAML files..." | |
| ERRORS=0 | |
| for f in $(find labs -name '*.yml' -o -name '*.yaml'); do | |
| if ! python3 -c "import yaml, sys; yaml.safe_load_all(open('$f'))" 2>/dev/null; then | |
| echo "FAIL: $f" | |
| ERRORS=$((ERRORS + 1)) | |
| else | |
| echo " ok: $f" | |
| fi | |
| done | |
| if [ "$ERRORS" -gt 0 ]; then | |
| echo "$ERRORS file(s) failed validation" | |
| exit 1 | |
| fi | |
| echo "All YAML files valid" | |
| - name: Lint with kubeval | |
| uses: instrumenta/kubeval-action@master | |
| with: | |
| files: labs | |
| continue-on-error: true | |
| - name: shellcheck scripts | |
| run: | | |
| sudo apt-get install -y shellcheck | |
| shellcheck scripts/*.sh || true |