mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fd1fc7c7fe
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.5 to 3.4.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2.1.5...d0a58c1c4d2b25278816e339b944508c875f3613) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
name: cli
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'release*'
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'docs/**'
|
|
- '.github/config.yml'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- 'release*'
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- '.github/config.yml'
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
cli-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
|
|
|
- name: Unshallow
|
|
run: git fetch --prune --unshallow
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@d0a58c1c4d2b25278816e339b944508c875f3613 # v3.4.0
|
|
with:
|
|
go-version: ~1.18.6
|
|
|
|
- name: Cache Go modules
|
|
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # pin@v3
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Test Policy
|
|
run: |
|
|
if [[ ${{ github.event_name }} == "push" ]]
|
|
then
|
|
export TEST_GIT_BRANCH=${GITHUB_REF##*/}
|
|
elif [[ ${{ github.event_name }} == "pull_request" ]]
|
|
then
|
|
export TEST_GIT_BRANCH=${{ github.event.pull_request.base.ref }}
|
|
fi
|
|
make -j4 test-cli
|
|
CLI_PATH=$PWD/cmd/cli/kubectl-kyverno/kubectl-kyverno
|
|
$CLI_PATH test ./test/cli/test-fail/missing-policy && exit 1 || exit 0
|
|
$CLI_PATH test ./test/cli/test-fail/missing-rule && exit 1 || exit 0
|
|
$CLI_PATH test ./test/cli/test-fail/missing-resource && exit 1 || exit 0
|