mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-08-22 05:36:29 +00:00
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
name: test
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
HELM_VERSION: 4.2.3
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
- uses: ./.github/actions/runner-cleanup
|
|
- name: Setup Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version: 1.26.x
|
|
cache-dependency-path: |
|
|
**/go.sum
|
|
**/go.mod
|
|
- name: Setup Flux Schema CLI
|
|
uses: fluxcd/flux-schema/actions/setup@9946a7cd4487b6d47cc9cd27d19ec8a274941af6 # v0.11.0
|
|
- name: Setup Helm
|
|
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
|
|
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@69e421aebbed979ded721df0da2a54428c5b4b9c # v0.27.0
|
|
- name: Run unit tests
|
|
run: make test
|
|
- name: Validate Helm chart
|
|
run: |
|
|
helm lint ./charts/podinfo/
|
|
helm template ./charts/podinfo/ | flux-schema validate -s ecosystem --verbose
|
|
- name: Validate Kustomize overlay
|
|
run: |
|
|
kubectl kustomize ./kustomize/ | flux-schema validate -s ecosystem --verbose
|
|
- 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 debug_values.cue | flux-schema validate -s ecosystem --verbose
|
|
- name: Check if working tree is dirty
|
|
run: |
|
|
if [[ $(git diff --stat) != '' ]]; then
|
|
echo 'run make test and commit changes'
|
|
exit 1
|
|
fi
|