Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): added unittest workflow #164

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Helm unit tests

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:
- name: fail if safe-to-test label NOT applied
aali309 marked this conversation as resolved.
Show resolved Hide resolved
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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this blank line can be removed

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.15.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using v3.14.4 in other CI. Let's keep it at 3.14 for now and bump later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or may be change v3.14.4 to match the latest?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure that would work! Though, it's better to bump the version in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If something goes wrong with fetching the latest version the action will use the hardcoded default stable version (currently v3.13.3). If you rely on a certain version higher than the default, you should explicitly use that version instead of latest.

We need to be careful there since helm 3.13 might be used, while the min helm version required is 3.14.

- name: Install unit test plugin
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git
- name: Run Helm unit tests
run: helm unittest --debug ./charts/cryostat