Skip to content

Commit

Permalink
test: refactor some duplicate code
Browse files Browse the repository at this point in the history
Signed-off-by: Niccolò Fei <[email protected]>
  • Loading branch information
NiccoloFei committed Nov 28, 2024
1 parent 534144c commit 6e5431f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 50 deletions.
24 changes: 24 additions & 0 deletions .github/actions/setup-kind/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup Kind
description: Sets up a kind cluster and installs Helm and kubectl
outputs:
helm-path:
description: The path to the Helm binary
value: ${{ steps.helm.outputs.helm-path }}
kubectl-path:
description: The path to the kubectl binary
value: ${{ steps.kubectl.outputs.kubectl-path }}
runs:
using: composite
steps:
- id: helm
name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.16.2

- id: kubectl
name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Create kind cluster
uses: helm/[email protected]
60 changes: 10 additions & 50 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3

- name: Create kind cluster
uses: helm/[email protected]
- name: Setup kind
uses: ./.github/actions/setup-kind

- name: Deploy using helm chart
run: |
Expand All @@ -57,9 +52,6 @@ jobs:
--set image.imageCredentials.password=${{ secrets.CS_PASSWORD }} \
--wait --timeout 10m
- name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Deploy a cluster
run: |
kubectl apply -f hack/samples/ep4k-cluster.yaml
Expand All @@ -78,13 +70,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3

- name: Create kind cluster
uses: helm/[email protected]
- name: Setup kind
uses: ./.github/actions/setup-kind

- name: Deploy using helm chart
run: |
Expand All @@ -95,9 +82,6 @@ jobs:
--set image.imageCredentials.password=${{ secrets.CS_PASSWORD }} \
--wait --timeout 10m
- name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Deploy a cluster
run: |
kubectl apply -f hack/samples/ep4k-cluster.yaml
Expand All @@ -116,13 +100,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3

- name: Create kind cluster
uses: helm/[email protected]
- name: Setup kind
uses: ./.github/actions/setup-kind

- name: Deploy using helm chart
run: |
Expand All @@ -134,9 +113,6 @@ jobs:
--set image.imageCredentials.password=${{ secrets.CS_PASSWORD }} \
--wait --timeout 10m
- name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Deploy a cluster
run: |
kubectl apply -f hack/samples/issuer-selfsigned.yaml
Expand All @@ -158,13 +134,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3

- name: Create kind cluster
uses: helm/[email protected]
- name: Setup kind
uses: ./.github/actions/setup-kind

- name: Deploy in single-namespace mode using helm chart
run: |
Expand All @@ -175,9 +146,6 @@ jobs:
--set image.imageCredentials.password=${{ secrets.CS_PASSWORD }} \
--wait --timeout 10m
- name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Deploy a cluster in the watched namespace
run: |
kubectl -n single-install apply -f hack/samples/ep4k-cluster.yaml
Expand All @@ -201,13 +169,8 @@ jobs:
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4
with:
version: v3.11.3

- name: Create kind cluster
uses: helm/[email protected]
- name: Setup kind
uses: ./.github/actions/setup-kind

- name: Deploy in single-namespace mode using helm chart use different namespace
run: |
Expand All @@ -220,9 +183,6 @@ jobs:
--set image.imageCredentials.password=${{ secrets.CS_PASSWORD }} \
--wait --timeout 10m
- name: Install kubectl
uses: azure/setup-kubectl@v4

- name: Deploy a cluster in the watched namespace
run: |
kubectl -n single-install apply -f hack/samples/ep4k-cluster.yaml
Expand Down

0 comments on commit 6e5431f

Please sign in to comment.