From 10de04fb34d1fda25ba74397508f13938f593a20 Mon Sep 17 00:00:00 2001 From: Daniel Chavero Date: Wed, 5 Jul 2023 17:53:04 +0200 Subject: [PATCH] add test workflow (#63) --- .github/workflows/test-reports.yaml | 16 ++++++++++++++++ .github/workflows/tests.yml | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/test-reports.yaml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/test-reports.yaml b/.github/workflows/test-reports.yaml new file mode 100644 index 0000000..f611608 --- /dev/null +++ b/.github/workflows/test-reports.yaml @@ -0,0 +1,16 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['Test'] # runs after CI workflow + types: + - completed +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results # artifact name + name: JEST Tests # Name of the check run which will be created + path: '*.xml' # Path to test results (inside artifact .zip) + reporter: jest-junit # Format of test results diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..031f352 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,21 @@ +name: Test +on: + pull_request: + +env: + KUBECONFIG: "/home/gh-action/.kcli/clusters/ocp-test/auth/kubeconfig" + +jobs: + scorecard: + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - name: Build bundle + run: make bundle + - name: Run scorecard tests + run: operator-sdk scorecard ./bundle -o xunit > scorecard-tests.xml + - uses: actions/upload-artifact@v2 # upload test results + if: success() || failure() # run this step even if previous step failed + with: + name: test-results + path: scorecard-tests.xml