mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-03-04 11:00:23 +00:00
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: test
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Restore Go cache
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: ${{ runner.os }}-go-
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.15.x
|
|
- name: Run unit tests
|
|
run: make test
|
|
- name: Check if working tree is dirty
|
|
run: |
|
|
if [[ $(git diff --stat) != '' ]]; then
|
|
echo 'run make test and commit changes'
|
|
exit 1
|
|
fi
|
|
- name: Validate Helm chart
|
|
uses: stefanprodan/kube-tools@v1
|
|
with:
|
|
command: |
|
|
helmv3 template ./charts/podinfo | kubeval --strict
|
|
- name: Validate kustomization
|
|
uses: stefanprodan/kube-tools@v1
|
|
with:
|
|
command: |
|
|
kustomize build ./kustomize | kubeval --strict
|
|
kustomize build ./kustomize | conftest test -p .github/policy -
|