diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 9a7782d..a3cbe6a 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -7,7 +7,7 @@ on: - 'master' jobs: - kind: + kind-helm: strategy: matrix: helm-version: @@ -17,27 +17,8 @@ jobs: 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.14.x - name: Setup Kubernetes uses: engineerd/setup-kind@v0.4.0 - - 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: Build container image run: | GIT_COMMIT=$(git rev-list -1 HEAD) && \ diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 670ac6e..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: lint - -on: - pull_request: - push: - branches: - - 'master' - -jobs: - validate: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: helm - uses: stefanprodan/kube-tools@v1 - with: - command: | - helmv3 template ./charts/podinfo | kubeval --strict - - name: kubeval - uses: stefanprodan/kube-tools@v1 - with: - command: | - kustomize build ./kustomize | kubeval --strict - - name: conftest - uses: stefanprodan/kube-tools@v1 - with: - command: | - kustomize build ./kustomize | conftest test -p .github/policy - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d6c090c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,43 @@ +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.14.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 - diff --git a/README.md b/README.md index f2a5be1..0129145 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # podinfo [![e2e](https://github.com/stefanprodan/podinfo/workflows/e2e/badge.svg)](https://github.com/stefanprodan/podinfo/blob/master/.github/workflows/e2e.yml) +[![test](https://github.com/stefanprodan/podinfo/workflows/test/badge.svg)](https://github.com/stefanprodan/podinfo/blob/master/.github/workflows/test.yml) [![release](https://github.com/stefanprodan/podinfo/workflows/release/badge.svg)](https://github.com/stefanprodan/podinfo/blob/master/.github/workflows/release.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/stefanprodan/podinfo)](https://goreportcard.com/report/github.com/stefanprodan/podinfo) [![Docker Pulls](https://img.shields.io/docker/pulls/stefanprodan/podinfo)](https://hub.docker.com/r/stefanprodan/podinfo)