Skip to content

ci(deps): bump the github-actions group across 1 directory with 5 updates #252

ci(deps): bump the github-actions group across 1 directory with 5 updates

ci(deps): bump the github-actions group across 1 directory with 5 updates #252

Workflow file for this run

# © 2026 NetApp, Inc. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# See the NOTICE file in the repo root for trademark and attribution details.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
lint:
name: validate-and-lint
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- name: Install dev deps
run: pip install -r requirements-dev.txt
- name: Ruff lint — Python examples
run: ruff check python/
- name: Ruff format check
run: ruff format --check python/
- name: Validate example catalog
run: python scripts/validate_catalog.py
# Copilot and Cursor assets are generated from ai/. Fail the build when a
# generated copy is edited directly, or when ai/ changes without a regen.
- name: Verify AI assets match ai/
run: |
python scripts/generate_ai_assets.py --self-test
python scripts/generate_ai_assets.py --check
# Every tool root indexes its products, and every product directory
# documents its own examples — including placeholders with no examples yet.
- name: Verify example directories have READMEs
run: |
ERRORS=0
for dir in python ansible terraform go \
python/ontap ansible/ontap terraform/ontap go/ontap \
python/console/local ansible/console/local \
terraform/console/local go/console/local; do
if [ ! -f "$dir/README.md" ]; then
echo "::error::Missing README.md in $dir/"
ERRORS=$((ERRORS + 1))
else
echo " OK $dir/README.md"
fi
done
[ "$ERRORS" -eq 0 ] || exit 1
- name: Verify NetApp copyright header on source files
run: |
MARKER="NetApp, Inc. All Rights Reserved"
MISSING=0
mapfile -t FILES < <(git ls-files \
'python/*.py' \
'ansible/*.yml' \
'terraform/**/*.tf' \
'go/**/*.go' \
'docs/example-template/**/*.py' \
'docs/example-template/**/*.yml' \
'docs/example-template/**/*.tf' \
'.github/scripts/*.sh' \
'docs/*.html' \
| grep -Ev '(\.example$|requirements\.|inventory/|group_vars/|example-template/go/)')
for f in "${FILES[@]}"; do
if ! head -10 "$f" | grep -q "$MARKER"; then
echo "::error file=$f::Missing NetApp copyright header"
MISSING=$((MISSING + 1))
fi
done
if [ "$MISSING" -gt 0 ]; then
echo "::error::$MISSING file(s) missing the required header. See CONTRIBUTING.md > Copyright headers."
exit 1
fi
echo "All checked files carry the NetApp copyright header."
go-vet:
name: go-vet
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# The examples use only the standard library, so there is no go.sum to
# hash. Keying the cache on go.mod keeps setup-go's cache step valid; it
# silently skipped caching while this pointed at a file that never existed.
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go/go.mod
cache-dependency-path: go/go.mod
- name: go vet
working-directory: go
run: go vet ./...
# Programs live under go/<product>/<use_case>/, so main.go is found
# recursively from the module root.
- name: Build-check all programs
working-directory: go
run: |
ERRORS=0
FOUND=0
for dir in $(find . -name main.go -exec dirname {} \; | sort); do
FOUND=$((FOUND + 1))
echo "Building ${dir} …"
(cd "${dir}" && go build -o /dev/null .) || ERRORS=$((ERRORS + 1))
done
if [ "$FOUND" -eq 0 ]; then
echo "::error::No Go programs found — check the directory layout"
exit 1
fi
[ "$ERRORS" -eq 0 ] || exit 1