1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00
kyverno/.github/workflows/cli.yaml
dependabot[bot] 8edfc37a9e
chore(deps): bump actions/checkout from 2.4.0 to 3.1.0 (#5564)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.1.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8)

---
updated-dependencies:
- dependency-name: actions/checkout
  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>
2022-12-05 09:43:16 +01:00

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@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2.1.5
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