forked from kyverno/kyverno
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (60 loc) · 1.97 KB
/
Copy pathcheck-cli-tests.yaml
File metadata and controls
66 lines (60 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: CLI
permissions: {}
on:
pull_request:
branches:
- main
- release-*
push:
branches:
- main
- release-*
concurrency:
group: ${{ github.workflow_ref }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
check:
name: CLI tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Go
uses: ./.github/actions/go/setup
- name: Setup TEST_GIT_BRANCH
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
REF_NAME: ${{ github.ref_name }}
run: |
if [[ "$EVENT_NAME" == "pull_request" ]]; then
echo "TEST_GIT_BRANCH=$PR_BASE_REF" >> $GITHUB_ENV
else
echo "TEST_GIT_BRANCH=$REF_NAME" >> $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
$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
sync-issue:
if: always() && github.event_name == 'push'
needs:
- check
permissions:
issues: write
runs-on: ubuntu-slim
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Sync issue
uses: ./.github/actions/workflow/failure-issue
with:
conclusion: ${{ contains(needs.*.result, 'failure') && 'failure' || job.status }}
needs: ${{ toJSON(needs) }}