-
Notifications
You must be signed in to change notification settings - Fork 244
86 lines (80 loc) · 2.54 KB
/
ci.yml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Policy Test
permissions: {}
on:
pull_request:
branches:
- main
- release-*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
artifacthub-lint:
runs-on: ubuntu-latest
container:
image: artifacthub/ah
options: --user root
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: policies
- name: Run ah lint
working-directory: .
run: ah lint -k kyverno
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: policies
- name: Validate all policies
run: ./.hack/verify-files-structure.sh
working-directory: policies
- name: Clone Kyverno
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: kyverno/kyverno
path: kyverno
# The target branch of a pull request or the branch/tag of a push
ref: ${{ github.base_ref || github.ref_name }}
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: ~1.21.1
- name: Test Policy
run: go run ./cmd/cli/kubectl-kyverno test ../policies
working-directory: kyverno
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: policies
- name: Checkout Kyverno
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: kyverno/kyverno
path: kyverno
# The target branch of a pull request or the branch/tag of a push
ref: ${{ github.base_ref || github.ref_name }}
- name: Set up Go
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: ~1.21.1
- name: Lint policies
run: |
set -e
KYVERNO_EXPERIMENTAL=true go run ./cmd/cli/kubectl-kyverno fix test . --save
working-directory: kyverno
- name: Check artifacthub-pkg digests
run: ./.hack/update-artifacthub-pkg.sh
working-directory: policies
- name: Check diff
run: |
set -e
git --no-pager diff .
git diff --quiet --exit-code .
working-directory: policies