2022-05-03 05:15:53 -04:00
|
|
|
name: sonobuoy
|
2022-11-01 07:23:01 -04:00
|
|
|
description: "Execute the e2e test framework sonobuoy."
|
2022-10-24 12:47:03 -04:00
|
|
|
|
2022-05-03 05:15:53 -04:00
|
|
|
inputs:
|
2023-04-13 06:02:19 -04:00
|
|
|
artifactNameSuffix:
|
|
|
|
description: "Suffix for artifact naming."
|
2022-11-29 04:49:10 -05:00
|
|
|
required: true
|
2022-05-03 05:15:53 -04:00
|
|
|
sonobuoyTestSuiteCmd:
|
2022-08-02 09:34:17 -04:00
|
|
|
description: "Which tests should be run?"
|
2023-04-13 06:02:19 -04:00
|
|
|
required: true
|
2022-10-24 12:47:03 -04:00
|
|
|
kubeconfig:
|
|
|
|
description: "The kubeconfig of the cluster to test."
|
2022-05-03 05:15:53 -04:00
|
|
|
required: true
|
2022-10-24 12:47:03 -04:00
|
|
|
|
2022-05-03 05:15:53 -04:00
|
|
|
runs:
|
2022-08-02 09:34:17 -04:00
|
|
|
using: "composite"
|
2022-05-03 05:15:53 -04:00
|
|
|
steps:
|
2022-08-02 09:34:17 -04:00
|
|
|
- name: Install sonobuoy
|
2022-10-24 12:47:03 -04:00
|
|
|
shell: bash
|
2023-01-27 11:57:36 -05:00
|
|
|
env:
|
2023-06-15 10:54:38 -04:00
|
|
|
SONOBUOY_VER: "0.56.17"
|
2022-08-02 09:34:17 -04:00
|
|
|
run: |
|
2022-09-14 10:30:13 -04:00
|
|
|
HOSTOS="$(go env GOOS)"
|
|
|
|
HOSTARCH="$(go env GOARCH)"
|
2023-01-27 11:57:36 -05:00
|
|
|
curl -fsSLO https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VER}/sonobuoy_${SONOBUOY_VER}_${HOSTOS}_${HOSTARCH}.tar.gz
|
|
|
|
tar -xzf sonobuoy_${SONOBUOY_VER}_${HOSTOS}_${HOSTARCH}.tar.gz
|
2022-08-02 09:34:17 -04:00
|
|
|
install sonobuoy /usr/local/bin
|
2022-10-24 12:47:03 -04:00
|
|
|
|
2022-08-02 09:34:17 -04:00
|
|
|
- name: Sonobuoy version
|
|
|
|
shell: bash
|
2023-01-18 04:15:58 -05:00
|
|
|
run: sonobuoy version
|
2022-05-03 05:15:53 -04:00
|
|
|
|
2022-11-29 04:49:10 -05:00
|
|
|
- name: Run e2e test
|
2022-08-02 09:34:17 -04:00
|
|
|
shell: bash
|
2022-10-24 12:47:03 -04:00
|
|
|
env:
|
|
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
|
|
|
run: sonobuoy run --wait=300 ${{ inputs.sonobuoyTestSuiteCmd }} --kubeconfig constellation-admin.conf
|
|
|
|
|
2022-08-02 09:34:17 -04:00
|
|
|
- name: Download results
|
|
|
|
shell: bash
|
2022-10-24 12:47:03 -04:00
|
|
|
env:
|
|
|
|
KUBECONFIG: ${{ inputs.kubeconfig }}
|
2022-11-29 04:49:10 -05:00
|
|
|
run: sonobuoy retrieve --kubeconfig constellation-admin.conf
|
2022-10-24 12:47:03 -04:00
|
|
|
|
2022-08-02 09:34:17 -04:00
|
|
|
- name: Upload test results
|
2023-01-17 12:49:00 -05:00
|
|
|
if: always() && !env.ACT
|
2023-01-06 11:35:54 -05:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
|
2022-08-02 09:34:17 -04:00
|
|
|
with:
|
2023-04-13 06:02:19 -04:00
|
|
|
name: "sonobuoy-logs-${{ inputs.artifactNameSuffix }}.tar.gz"
|
2023-04-15 13:24:48 -04:00
|
|
|
path: "*_sonobuoy_*.tar.gz"
|
2022-10-24 12:47:03 -04:00
|
|
|
|
2023-03-17 11:28:11 -04:00
|
|
|
# Only works on "sonobuoy full" tests (e2e plugin)
|
2023-03-20 08:32:58 -04:00
|
|
|
- name: Extract test results
|
|
|
|
if: (!env.ACT) && contains(inputs.sonobuoyTestSuiteCmd, '--plugin e2e')
|
|
|
|
shell: bash
|
2023-04-15 13:24:48 -04:00
|
|
|
run: tar -xf *_sonobuoy_*.tar.gz
|
2023-03-20 08:32:58 -04:00
|
|
|
|
2022-08-02 09:34:17 -04:00
|
|
|
- name: Publish test results
|
2023-03-17 11:28:11 -04:00
|
|
|
if: (!env.ACT) && contains(inputs.sonobuoyTestSuiteCmd, '--plugin e2e')
|
2023-04-03 10:36:43 -04:00
|
|
|
uses: mikepenz/action-junit-report@959aefb7f095e717eb407fe917238d61ca323ff3 # v3.7.6
|
2022-08-02 09:34:17 -04:00
|
|
|
with:
|
|
|
|
report_paths: "**/junit_01.xml"
|
|
|
|
fail_on_failure: true
|