Skip to content

Commit

Permalink
CRC Testing 4
Browse files Browse the repository at this point in the history
  • Loading branch information
sebrandon1 committed Jan 13, 2025
1 parent 8ade1f6 commit e56f84e
Showing 1 changed file with 114 additions and 0 deletions.
114 changes: 114 additions & 0 deletions .github/workflows/qe-ocp-hosted.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz

name: CRC Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
QE_REPO: redhat-best-practices-for-k8s/certsuite-qe

jobs:
build-and-store:
# build and store the image
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- name: Setup docker buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0

- name: Build temporary image tag for this PR
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0
with:
context: .
file: ./Dockerfile
tags: quay.io/redhat-best-practices-for-k8s/certsuite:localtest
outputs: type=docker,dest=/tmp/testimage.tar

- name: Store image as artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: testimage
path: /tmp/testimage.tar


smoke-tests:
name: CRC QE Tests
runs-on: ubuntu-22.04
needs: build-and-store
if: needs.build-and-store.result == 'success'
strategy:
fail-fast: false
matrix:
#suite: [observability]
suite: [accesscontrol, affiliatedcertification, manageability, networking, lifecycle, performance, platformalteration, observability, operator]
env:
SHELL: /bin/bash
KUBECONFIG: '/home/runner/.crc/machines/crc/kubeconfig'
PFLT_DOCKERCONFIG: '/home/runner/.docker/config'
DOCKER_CONFIG_DIR: '/home/runner/.docker/'
TEST_CERTSUITE_IMAGE_NAME: quay.io/redhat-best-practices-for-k8s/certsuite
TEST_CERTSUITE_IMAGE_TAG: localtest

steps:
- name: Write temporary docker file
run: |
mkdir -p /home/runner/.docker
touch ${PFLT_DOCKERCONFIG}
echo '{ "auths": {} }' >> ${PFLT_DOCKERCONFIG}
if: runner.os == 'Linux'

- name: Disable default go problem matcher
run: echo "::remove-matcher owner=go::"

- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- name: check if CRC_PULL_SECRET exists, if not, exit
env:
super_secret: ${{ secrets.CRC_PULL_SECRET }}
if: ${{ env.super_secret == '' }}
run: |
echo "CRC_PULL_SECRET is not set"
exit 1
- name: Deploy the OCP Cluster
uses: palmsoftware/[email protected]
with:
ocpPullSecret: $OCP_PULL_SECRET
env:
OCP_PULL_SECRET: ${{ secrets.CRC_PULL_SECRET }}

- name: Clone the QE repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: ${{ env.QE_REPO }}
path: certsuite-qe
ref: main

- name: Download image from artifact
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: testimage
path: /tmp

- name: Load image into docker
run: docker load --input /tmp/testimage.tar

- name: Run the tests (against image)
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
with:
timeout_minutes: 60
max_attempts: 3
command: cd ${GITHUB_WORKSPACE}/certsuite-qe; FEATURES=${{matrix.suite}} CERTSUITE_REPO_PATH=${GITHUB_WORKSPACE} CERTSUITE_IMAGE=${{env.TEST_CERTSUITE_IMAGE_NAME}} CERTSUITE_IMAGE_TAG=${{env.TEST_CERTSUITE_IMAGE_TAG}} JOB_ID=${{github.run_id}} DISABLE_INTRUSIVE_TESTS=true ENABLE_PARALLEL=true ENABLE_FLAKY_RETRY=true make test-features

0 comments on commit e56f84e

Please sign in to comment.