mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
26cb829e65
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](a5ac7e51b4...692973e3d9
)
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
86 lines
2.9 KiB
YAML
86 lines
2.9 KiB
YAML
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
|
|
|
name: cli
|
|
|
|
permissions: {}
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'release*'
|
|
pull_request:
|
|
branches:
|
|
- 'main'
|
|
- 'release*'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
cli-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
- name: Setup caches
|
|
uses: ./.github/actions/setup-caches
|
|
timeout-minutes: 5
|
|
continue-on-error: true
|
|
with:
|
|
build-cache-key: cli-test
|
|
- name: Setup build env
|
|
uses: ./.github/actions/setup-build-env
|
|
timeout-minutes: 10
|
|
- name: Setup TEST_GIT_BRANCH
|
|
run: |
|
|
if [[ ${{ github.event_name }} == "push" ]]
|
|
then
|
|
echo "TEST_GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
elif [[ ${{ github.event_name }} == "pull_request" ]]
|
|
then
|
|
echo "TEST_GIT_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
|
|
fi
|
|
- name: Test CLI
|
|
run: |
|
|
KYVERNO_KUBECTL_VALIDATE=false VERSION=${{ github.ref_name }} make test-cli
|
|
- name: Test CLI (failures)
|
|
run: |
|
|
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
|
|
|
|
kubectl-validate-cli-test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
- name: Setup caches
|
|
uses: ./.github/actions/setup-caches
|
|
timeout-minutes: 5
|
|
continue-on-error: true
|
|
with:
|
|
build-cache-key: cli-test
|
|
- name: Setup build env
|
|
uses: ./.github/actions/setup-build-env
|
|
timeout-minutes: 10
|
|
- name: Setup TEST_GIT_BRANCH
|
|
run: |
|
|
if [[ ${{ github.event_name }} == "push" ]]
|
|
then
|
|
echo "TEST_GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
|
|
elif [[ ${{ github.event_name }} == "pull_request" ]]
|
|
then
|
|
echo "TEST_GIT_BRANCH=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
|
|
fi
|
|
- name: Test CLI
|
|
run: |
|
|
VERSION=${{ github.ref_name }} make test-cli
|
|
- name: Test CLI (failures)
|
|
run: |
|
|
CLI_PATH=$PWD/cmd/cli/kubectl-kyverno/kubectl-kyverno
|
|
KYVERNO_KUBECTL_VALIDATE=true $CLI_PATH test ./test/cli/test-fail/missing-policy && exit 1 || exit 0
|
|
KYVERNO_KUBECTL_VALIDATE=true $CLI_PATH test ./test/cli/test-fail/missing-rule && exit 1 || exit 0
|
|
KYVERNO_KUBECTL_VALIDATE=true $CLI_PATH test ./test/cli/test-fail/missing-resource && exit 1 || exit 0
|