name: test on: pull_request: push: branches: - 'master' permissions: contents: read env: KUBERNETES_VERSION: 1.35.0 HELM_VERSION: 4.1.1 jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: ./.github/actions/runner-cleanup - name: Setup Go uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 with: go-version: 1.26.x cache-dependency-path: | **/go.sum **/go.mod - name: Setup kubectl uses: azure/setup-kubectl@15650b3ad78fff148532a140b8a4c821796b2d7b # v5.0.0 with: version: v${{ env.KUBERNETES_VERSION }} - name: Setup kubeconform uses: ./.github/actions/kubeconform - name: Setup Helm uses: azure/setup-helm@dda3372f752e03dde6b3237bc9431cdc2f7a02a2 # v5.0.0 with: version: v${{ env.HELM_VERSION }} - name: Setup CUE uses: cue-lang/setup-cue@a93fa358375740cd8b0078f76355512b9208acb1 # v1.0.1 - name: Setup Timoni uses: stefanprodan/timoni/actions/setup@c68e33a34f17c7ca93c7fc6717d61a14819276dc # v0.26.0 - name: Run unit tests run: make test - name: Validate Helm chart run: | helm lint ./charts/podinfo/ helm template ./charts/podinfo/ | kubeconform -strict -summary -kubernetes-version ${{ env.KUBERNETES_VERSION }} - name: Validate Kustomize overlay run: | kubectl kustomize ./kustomize/ | kubeconform -strict -summary -kubernetes-version ${{ env.KUBERNETES_VERSION }} - name: Verify CUE formatting working-directory: ./timoni/podinfo run: | cue fmt ./... status=$(git status . --porcelain) [[ -z "$status" ]] || { echo "CUE files are not correctly formatted" echo "$status" git diff exit 1 } - name: Validate Timoni module working-directory: ./timoni/podinfo run: | timoni mod lint . timoni build podinfo . -f test_values.cue | kubeconform -strict -summary -skip=ServiceMonitor -kubernetes-version ${{ env.KUBERNETES_VERSION }} - name: Check if working tree is dirty run: | if [[ $(git diff --stat) != '' ]]; then echo 'run make test and commit changes' exit 1 fi