|
| 1 | +--- |
| 2 | +name: QE Testing (Minikube) |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: [ main ] |
| 7 | + paths: |
| 8 | + - 'tests/**' |
| 9 | + - 'go.mod' |
| 10 | + - 'go.sum' |
| 11 | + - '.github/workflows/qe-ocp.yml' |
| 12 | + - '.github/workflows/qe-minikube.yml' |
| 13 | + workflow_dispatch: |
| 14 | + # Schedule a daily cron at midnight UTC |
| 15 | + schedule: |
| 16 | + - cron: '0 0 * * *' |
| 17 | + |
| 18 | +concurrency: |
| 19 | + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} |
| 20 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 21 | + |
| 22 | +env: |
| 23 | + TEST_REPO: redhat-best-practices-for-k8s/certsuite |
| 24 | + CERTSUITE_REF: main |
| 25 | + |
| 26 | +jobs: |
| 27 | + # Build and store the certsuite binary |
| 28 | + build-and-store-binary: |
| 29 | + runs-on: ubuntu-24.04 |
| 30 | + steps: |
| 31 | + - name: Check out code |
| 32 | + uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0 |
| 33 | + with: |
| 34 | + ref: ${{ github.sha }} |
| 35 | + |
| 36 | + - name: Set up Go |
| 37 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 38 | + with: |
| 39 | + go-version-file: go.mod |
| 40 | + |
| 41 | + - name: Clone the certsuite repository |
| 42 | + uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0 |
| 43 | + with: |
| 44 | + repository: ${{ env.TEST_REPO }} |
| 45 | + path: certsuite |
| 46 | + ref: ${{ env.CERTSUITE_REF }} |
| 47 | + |
| 48 | + - name: Extract dependent Pull Requests |
| 49 | + uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main |
| 50 | + with: |
| 51 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + extra-dirs: certsuite |
| 53 | + |
| 54 | + - name: Build the certsuite binary |
| 55 | + run: make build-certsuite-tool |
| 56 | + working-directory: certsuite |
| 57 | + |
| 58 | + - name: Upload certsuite binary as artifact |
| 59 | + uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 |
| 60 | + with: |
| 61 | + name: certsuite-binary |
| 62 | + path: certsuite/certsuite |
| 63 | + retention-days: 1 |
| 64 | + |
| 65 | + qe-testing-minikube: |
| 66 | + needs: [build-and-store-binary] |
| 67 | + if: ${{ needs.build-and-store-binary.result == 'success' }} |
| 68 | + runs-on: ubuntu-24.04 |
| 69 | + strategy: |
| 70 | + fail-fast: false |
| 71 | + matrix: |
| 72 | + suite: [accesscontrol, affiliatedcertification, manageability, networking, lifecycle, performance, platformalteration, observability, operator] |
| 73 | + env: |
| 74 | + SHELL: /bin/bash |
| 75 | + KUBECONFIG: '/home/runner/.kube/config' |
| 76 | + PFLT_DOCKERCONFIG: '/home/runner/.docker/config' |
| 77 | + TEST_CERTSUITE_IMAGE_NAME: quay.io/redhat-best-practices-for-k8s/certsuite |
| 78 | + TEST_CERTSUITE_IMAGE_TAG: localtest |
| 79 | + DOCKER_CONFIG_DIR: '/home/runner/.docker/' |
| 80 | + SKIP_PRELOAD_IMAGES: true # Not needed for github-hosted runs |
| 81 | + |
| 82 | + steps: |
| 83 | + - name: Write temporary docker file |
| 84 | + run: | |
| 85 | + mkdir -p /home/runner/.docker |
| 86 | + touch ${PFLT_DOCKERCONFIG} |
| 87 | + echo '{ "auths": {} }' >> ${PFLT_DOCKERCONFIG} |
| 88 | +
|
| 89 | + - name: Check out code |
| 90 | + uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0 |
| 91 | + with: |
| 92 | + ref: ${{ github.sha }} |
| 93 | + |
| 94 | + - name: Set up Go |
| 95 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 96 | + with: |
| 97 | + go-version-file: go.mod |
| 98 | + |
| 99 | + - name: Disable default go problem matcher |
| 100 | + run: echo "::remove-matcher owner=go::" |
| 101 | + |
| 102 | + - name: Check out `certsuite-sample-workload` |
| 103 | + uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0 |
| 104 | + with: |
| 105 | + repository: redhat-best-practices-for-k8s/certsuite-sample-workload |
| 106 | + path: certsuite-sample-workload |
| 107 | + |
| 108 | + - name: Install dependencies |
| 109 | + run: | |
| 110 | + sudo apt-get update |
| 111 | + sudo apt-get install -y python3-pip |
| 112 | +
|
| 113 | + - name: Setup minikube k8s cluster |
| 114 | + uses: palmsoftware/[email protected] |
| 115 | + with: |
| 116 | + clusterProvider: minikube |
| 117 | + disableDefaultCni: true |
| 118 | + numControlPlaneNodes: 1 |
| 119 | + numWorkerNodes: 2 |
| 120 | + installOLM: true |
| 121 | + removeDefaultStorageClass: true |
| 122 | + removeControlPlaneTaint: true |
| 123 | + |
| 124 | + - name: Install partner resources |
| 125 | + run: python3 -m venv .venv; source .venv/bin/activate; pip install --upgrade pip; pip install jinjanator; cp .venv/bin/jinjanate .venv/bin/j2; make install-for-qe |
| 126 | + working-directory: certsuite-sample-workload |
| 127 | + |
| 128 | + - name: Show pods |
| 129 | + run: oc get pods -A |
| 130 | + |
| 131 | + - name: Wait for all pods to be ready |
| 132 | + run: ./scripts/wait-for-all-pods-running.sh |
| 133 | + working-directory: certsuite-sample-workload |
| 134 | + timeout-minutes: 10 |
| 135 | + |
| 136 | + - name: Clone the certsuite repository |
| 137 | + uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0 |
| 138 | + with: |
| 139 | + repository: ${{ env.TEST_REPO }} |
| 140 | + path: certsuite |
| 141 | + ref: ${{ env.CERTSUITE_REF }} |
| 142 | + |
| 143 | + - name: Extract dependent Pull Requests |
| 144 | + uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main |
| 145 | + with: |
| 146 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 147 | + extra-dirs: certsuite-sample-workload certsuite |
| 148 | + |
| 149 | + - name: Download pre-built certsuite binary |
| 150 | + uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 |
| 151 | + with: |
| 152 | + name: certsuite-binary |
| 153 | + path: certsuite/ |
| 154 | + |
| 155 | + - name: Make binary executable |
| 156 | + run: chmod +x certsuite/certsuite |
| 157 | + |
| 158 | + # Only run against the binary during a scheduled run |
| 159 | + - name: Run the tests (against binary) |
| 160 | + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 |
| 161 | + with: |
| 162 | + timeout_minutes: 150 |
| 163 | + max_attempts: 3 |
| 164 | + command: FEATURES=${{matrix.suite}} CERTSUITE_REPO_PATH=${GITHUB_WORKSPACE}/certsuite USE_BINARY=true DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true JOB_ID=${{github.run_id}} make test-features |
| 165 | + |
| 166 | + check-all-dependencies-are-merged: |
| 167 | + runs-on: ubuntu-24.04 |
| 168 | + steps: |
| 169 | + |
| 170 | + - name: Extract dependent PR |
| 171 | + uses: depends-on/depends-on-action@61cb3f4a0e2c8ae4b90c9448dc57c7ba9ca24c35 # main |
| 172 | + with: |
| 173 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 174 | + check-unmerged-pr: true |
| 175 | + |
| 176 | +... |
| 177 | + |
0 commit comments