Skip to content

Commit bfa2cca

Browse files
committed
ci: addition of scorecard in CI
1 parent b672063 commit bfa2cca

File tree

3 files changed

+35
-16
lines changed

3 files changed

+35
-16
lines changed

.github/workflows/olm_scorecard.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Operator Scorecard Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
scorecard-check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check out code
10+
uses: actions/checkout@v2
11+
12+
- name: Setup and start KinD cluster
13+
uses: ./.github/actions/kind
14+
15+
- name: Install Operator SDK
16+
run: |
17+
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/v1.24.1/operator-sdk_linux_amd64
18+
chmod +x operator-sdk_linux_amd64
19+
sudo mv operator-sdk_linux_amd64 /usr/local/bin/operator-sdk
20+
21+
- name: Build bundle
22+
run: make bundle-build
23+
24+
- name: Install yq
25+
run: |
26+
sudo wget -O /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.6.1/yq_linux_amd64
27+
sudo chmod +x /usr/bin/yq
28+
29+
- name: Modify scorecard config
30+
run: |
31+
yq e 'del(.stages[].tests[] | select(.labels.test == "olm-crds-have-resources-test"))' -i bundle/tests/scorecard/config.yaml
32+
33+
- name: Run Operator SDK Scorecard
34+
run: make scorecard-bundle

.github/workflows/olm_tests.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,6 @@ jobs:
134134
BUNDLE_PUSH_OPT: "--tls-verify=false"
135135
CATALOG_PUSH_OPT: "--tls-verify=false"
136136

137-
- name: Install yq
138-
run: |
139-
sudo wget -O /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.6.1/yq_linux_amd64
140-
sudo chmod +x /usr/bin/yq
141-
142-
- name: Modify scorecard config
143-
run: |
144-
yq e 'del(.stages[].tests[] | select(.labels.test == "olm-crds-have-resources-test"))' -i bundle/tests/scorecard/config.yaml
145-
146-
- name: Scorecard check
147-
run: |
148-
make scorecard-bundle
149-
env:
150-
IMG: "${{ env.REGISTRY_ADDRESS }}/codeflare-operator:v0.0.1"
151-
152137
- name: Update Operator to the built version
153138
run: |
154139
ORIGINAL_POD_NAME=$(kubectl get pod -l app.kubernetes.io/name=codeflare-operator -n openshift-operators -o json | jq -r .items[].metadata.name)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,5 +469,5 @@ verify-imports: openshift-goimports ## Run import verifications.
469469
./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS)
470470

471471
.PHONY: scorecard-bundle
472-
scorecard-bundle: ## Run scorecard tests on bundle image.
472+
scorecard-bundle: install-operator-sdk ## Run scorecard tests on bundle image.
473473
$(OPERATOR_SDK) scorecard bundle

0 commit comments

Comments
 (0)