From ba1d8f85a06c377a0d615ad02e78d979cdd3a704 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Wed, 3 Jul 2024 13:01:48 -0400 Subject: [PATCH 1/2] added unittest workflow --- .github/workflows/unittest.yml | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 00000000..da92eb25 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,43 @@ +name: Helm Unittests + +on: + push: + branches: + - main + - v[0-9]+ + - v[0-9]+.[0-9]+ + - cryostat-v[0-9]+.[0-9]+ + + pull_request: + types: + - opened + - reopened + - synchronize + - labeled + - unlabeled + branches: + - main + - v[0-9]+ + - v[0-9]+.[0-9]+ + - cryostat-v[0-9]+.[0-9]+ + +jobs: + helm-unittests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: fail if safe-to-test label NOT applied + if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'safe-to-test') }} + run: exit 1 + - uses: actions/checkout@v4 + + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + version: v3.15.2 + - name: Install Unittest Plugin + run: helm plugin install https://github.com/helm-unittest/helm-unittest.git + - name: Run Helm Unittests + run: helm unittest --debug ./charts/cryostat From 78772070c7d14a8f1f63e67f5cf1e03a06c38498 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Wed, 3 Jul 2024 13:30:08 -0400 Subject: [PATCH 2/2] resolve issues --- .github/workflows/unittest.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index da92eb25..b3d49ce8 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -1,4 +1,4 @@ -name: Helm Unittests +name: Helm unit tests on: push: @@ -25,19 +25,18 @@ jobs: helm-unittests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: fail if safe-to-test label NOT applied if: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'safe-to-test') }} run: exit 1 - uses: actions/checkout@v4 - + with: + fetch-depth: 0 + - name: Set up Helm uses: azure/setup-helm@v4 with: version: v3.15.2 - - name: Install Unittest Plugin + - name: Install unit test plugin run: helm plugin install https://github.com/helm-unittest/helm-unittest.git - - name: Run Helm Unittests + - name: Run Helm unit tests run: helm unittest --debug ./charts/cryostat