-
Notifications
You must be signed in to change notification settings - Fork 31
111 lines (92 loc) · 3.83 KB
/
qe-ocp-pre-main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: OCP Pre-Main Testing
on:
pull_request:
branches: [ main ]
permissions:
contents: read
env:
QE_REPO: redhat-best-practices-for-k8s/certsuite-qe
KUBECONFIG: /home/labuser3/.kube/config
PFLT_DOCKERCONFIG: '/home/labuser3/.docker/config'
CERTSUITE_IMAGE_NAME: quay.io/redhat-best-practices-for-k8s/certsuite
TEST_CERTSUITE_IMAGE_TAG: localtest
DOCKER_CONFIG_DIR: '/home/labuser3/.docker'
CERTSUITE_CONFIG_DIR: '/home/labuser3/tnf_config'
CERTSUITE_REPORT_DIR: '/home/labuser3/tnf_report'
jobs:
# Build the image used for testing first, then pass the reference to the QE tests.
# This saves time and resources by not building the image in each QE suite.
build-image-for-qe:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.sha }}
- name: Setup docker buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- name: Build temporary image tag for this PR
uses: docker/build-push-action@16ebe778df0e7752d2cfcbd924afdbbd89c1a755 # v6.6.1
with:
context: .
file: ./Dockerfile
tags: |
${{ env.CERTSUITE_IMAGE_NAME }}:${{ env.TEST_CERTSUITE_IMAGE_TAG }}
outputs: type=docker,dest=/tmp/testimage.tar
- name: Store image as artifact
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
with:
name: testimage
path: /tmp/testimage.tar
qe-ocp-testing:
runs-on: qe-ocp-416
needs: build-image-for-qe
if: needs.build-image-for-qe.result == 'success'
strategy:
fail-fast: false
matrix:
suite: [affiliatedcertification, operator, observability]
env:
SHELL: /bin/bash
steps:
- name: Check out code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.sha }}
- name: Run initial setup
uses: ./.github/actions/setup
# Download the image from the artifact and load it into the docker daemon.
- name: Setup docker buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
- name: Download image from artifact
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: testimage
path: /tmp
- name: Load image into docker
run: docker load --input /tmp/testimage.tar
- name: Show pods
run: oc get pods -A
- name: Clone the QE repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: ${{ env.QE_REPO }}
path: certsuite-qe
ref: main
- name: Preemptively potential QE namespaces
run: ./scripts/delete-namespaces.sh
working-directory: certsuite-qe
- name: Preemptively delete contents of openshift-marketplace namespace
run: ./scripts/clean-marketplace.sh
working-directory: certsuite-qe
- name: Preemptively delete report and config folders
shell: bash
run: |
sudo rm -rf ${{env.CERTSUITE_CONFIG_DIR}}
sudo rm -rf ${{env.CERTSUITE_REPORT_DIR}}
- 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.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