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 committed Sep 5, 2023
1 parent 4b516ab commit 58104b1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/olm_scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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: Install Operator SDK
run: |
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/v1.24.1/operator-sdk_linux_amd64
chmod +x operator-sdk_linux_amd64
sudo mv operator-sdk_linux_amd64 /usr/local/bin/operator-sdk
- 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: operator-sdk scorecard bundle/tests/scorecard/config.yaml
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

0 comments on commit 58104b1

Please sign in to comment.