Skip to content

Add scorecard to ci #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/olm_scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Operator Scorecard Test

on: [push, pull_request]

jobs:
scorecard-check:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Setup and start KinD cluster
uses: ./.github/actions/kind

- name: Build bundle
run: make bundle-build

- name: Install yq
run: |
sudo wget -O /usr/bin/yq https://github.com/mikefarah/yq/releases/download/v4.6.1/yq_linux_amd64
sudo chmod +x /usr/bin/yq

- name: Modify scorecard config
run: |
yq e 'del(.stages[].tests[] | select(.labels.test == "olm-crds-have-resources-test"))' -i bundle/tests/scorecard/config.yaml

- name: Run Operator SDK Scorecard
run: make scorecard-bundle
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,7 @@ imports: openshift-goimports ## Organize imports in go files using openshift-goi
.PHONY: verify-imports
verify-imports: openshift-goimports ## Run import verifications.
./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS)

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