-
Notifications
You must be signed in to change notification settings - Fork 13
153 lines (113 loc) · 4.94 KB
/
main.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: CI
on: push
jobs:
operator-linting:
name: Operator Linting
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install Ansible
run: python -m pip install 'ansible <= 2.9'
- name: Install operator_sdk.util dependency for Ansible role linting
run: ansible-galaxy collection install operator_sdk.util
- name: Install ansible-lint
run: python -m pip install 'ansible-lint < 6.0.0'
- name: Lint Ansible roles/servicetelemetry/ directory
run: ${HOME}/.local/bin/ansible-lint roles/servicetelemetry
stf-run-ci-linting:
name: stf-run-ci Linting
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Install Ansible
run: python -m pip install 'ansible'
- name: Install ansible-lint
run: python -m pip install 'ansible-lint'
- name: Lint Ansible build/stf-run-ci directory
run: ${HOME}/.local/bin/ansible-lint .
working-directory: ./build/stf-run-ci
generate-bundle-diff-check:
name: Check if generating the bundle would result in local changes
runs-on: ubuntu-latest
env:
RELEASE_VERSION: v0.19.4
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Get operator-sdk image 0.19.4
run: curl --output operator-sdk -JL https://github.com/operator-framework/operator-sdk/releases/download/$RELEASE_VERSION/operator-sdk-$RELEASE_VERSION-x86_64-linux-gnu
- name: Make operator-sdk executable
run: chmod +x operator-sdk
- name: Move operator-sdk binary
run: sudo mv operator-sdk /usr/local/bin
- name: Generate bundle locally
run: operator-sdk generate bundle --manifests --metadata --default-channel stable-1.5 --channels stable-1.5
- name: Check if bundle generation results in local changes
run: git diff --exit-code
build-operator-check:
name: Build Operator check
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Verify image builds
run: docker build --tag infrawatch/service-telemetry-operator:latest --file build/Dockerfile .
build-bundle-check:
name: Build bundle check
runs-on: ubuntu-20.04
env:
RELEASE_VERSION: v0.19.4
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Get operator-sdk image 0.19.4
run: curl --output operator-sdk -JL https://github.com/operator-framework/operator-sdk/releases/download/$RELEASE_VERSION/operator-sdk-$RELEASE_VERSION-x86_64-linux-gnu
- name: Make operator-sdk executable
run: chmod +x operator-sdk
- name: Move operator-sdk binary
run: sudo mv operator-sdk /usr/local/bin
- name: Create working directory
run: mkdir /tmp/bundle
- name: Generate bundle
run: WORKING_DIR=/tmp/bundle ./build/generate_bundle.sh
- name: Verify image builds
run: docker build --tag infrawatch/service-telemetry-operator:latest --file build/Dockerfile .
check-bundle-validation-scorecard:
name: Validate the generated bundle and perform scorecard checks
runs-on: ubuntu-20.04
env:
RELEASE_VERSION: v1.26.0
steps:
- name: Checkout code
uses: actions/[email protected]
# prepare environment to buld the bundle
- name: Get operator-sdk image 0.19.4
run: curl --output operator-sdk -JL https://github.com/operator-framework/operator-sdk/releases/download/$RELEASE_VERSION/operator-sdk-$RELEASE_VERSION-x86_64-linux-gnu
env:
RELEASE_VERSION: v0.19.4
- name: Make operator-sdk executable
run: chmod +x operator-sdk
- name: Move operator-sdk binary
run: sudo mv operator-sdk /usr/local/bin
- name: Create working directory
run: mkdir /tmp/bundle
# generate the bundle using operator-sdk-0.19.4
- name: Generate bundle
run: WORKING_DIR=/tmp/bundle ./build/generate_bundle.sh
# prepare the environment to run bundle validation and bundle scorecard checks
- name: Get operator-sdk image 1.26.0
run: curl --output operator-sdk-$RELEASE_VERSION -JL https://github.com/operator-framework/operator-sdk/releases/download/$RELEASE_VERSION/operator-sdk_linux_amd64
- name: Make operator-sdk executable
run: chmod +x operator-sdk-$RELEASE_VERSION
- name: Move operator-sdk binary
run: sudo mv operator-sdk-$RELEASE_VERSION /usr/local/bin
# perform bundle validation
- name: Check bundle validation
run: operator-sdk-$RELEASE_VERSION bundle validate --verbose /tmp/bundle
- name: Create KinD cluster to execute scorecard tests
uses: helm/[email protected]
# perform scorecard checks against a KinD cluster
- name: Check scorecord validation
run: operator-sdk-$RELEASE_VERSION scorecard --verbose /tmp/bundle