Skip to content

Commit

Permalink
ci: addition of scorecard in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dimakis authored and openshift-merge-robot committed Sep 12, 2023
1 parent ff67b15 commit 7153445
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
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
15 changes: 0 additions & 15 deletions .github/workflows/olm_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,6 @@ jobs:
BUNDLE_PUSH_OPT: "--tls-verify=false"
CATALOG_PUSH_OPT: "--tls-verify=false"

- 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: Scorecard check
run: |
make scorecard-bundle
env:
IMG: "${{ env.REGISTRY_ADDRESS }}/codeflare-operator:v0.0.1"

- name: Update Operator to the built version
run: |
ORIGINAL_POD_NAME=$(kubectl get pod -l app.kubernetes.io/name=codeflare-operator -n openshift-operators -o json | jq -r .items[].metadata.name)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -469,5 +469,5 @@ verify-imports: openshift-goimports ## Run import verifications.
./hack/verify-imports.sh $(OPENSHIFT-GOIMPORTS)

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

0 comments on commit 7153445

Please sign in to comment.