Skip to content

Commit a1634b9

Browse files
committed
chore(ci): test prepare-cluster on pr
1 parent 17650df commit a1634b9

File tree

4 files changed

+86
-16
lines changed

4 files changed

+86
-16
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@ jobs:
1111
contents: write
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v4
16+
with:
17+
cache: "npm"
18+
cache-dependency-path: |
19+
**/package-lock.json
1520
16-
- name: package
17-
run: make package-all
21+
- name: package
22+
run: make package-all
1823

19-
- name: readme
20-
run: make readme-all
24+
- name: readme
25+
run: make readme-all
2126

22-
# Commit all changed files back to the repository (dist and readme files)
23-
- uses: stefanzweifel/git-auto-commit-action@v4
24-
with:
25-
commit_message: Automated commit of npm build result and updated readme files
27+
# Commit all changed files back to the repository (dist and readme files)
28+
- uses: stefanzweifel/git-auto-commit-action@v4
29+
with:
30+
commit_message: Automated commit of npm build result and updated readme files
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: test - prepare-cluster
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- prepare-cluster/**
9+
- create-release/**
10+
- create-customer/**
11+
- create-cluster/**
12+
- helm-install/**
13+
- kots-install/**
14+
15+
concurrency:
16+
group: test-prepare-cluster-${{ github.head_ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test:
21+
runs-on: ubuntu-latest
22+
env:
23+
WORDPRESS_CHART_VERSION: 22.2.8
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v4
28+
with:
29+
cache: "npm"
30+
cache-dependency-path: |
31+
**/package-lock.json
32+
33+
- name: build
34+
run: |
35+
set -e
36+
make package-create-release
37+
make package-create-customer
38+
make package-create-cluster
39+
make package-helm-install
40+
make package-kots-install
41+
42+
- name: pull helm chart
43+
run: |
44+
helm pull oci://registry-1.docker.io/bitnamicharts/wordpress --version ${{ env.WORDPRESS_CHART_VERSION }}
45+
46+
- name: test prepare-cluster
47+
id: prepare-cluster
48+
uses: ./prepare-cluster
49+
with:
50+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
51+
app-slug: replicated-actions-ci # from the Replicated QA team
52+
chart: wordpress-${{ env.WORDPRESS_CHART_VERSION }}.tgz
53+
kubernetes-distribution: kind
54+
helm-chart-name: wordpress
55+
helm-run-preflights: false
56+
57+
- name: remove cluster
58+
id: remove-cluster
59+
if: always()
60+
uses: replicatedhq/compatibility-actions/remove-cluster@v1
61+
continue-on-error: true # It could be that the cluster is already removed
62+
with:
63+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
64+
cluster-id: ${{ steps.prepare-cluster.outputs.cluster-id }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
**/build
2-
**/node_modules
2+
**/node_modules
3+
.vscode/

prepare-cluster/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ runs:
108108
steps:
109109
- name: 'Create Release'
110110
id: 'create-release'
111-
uses: replicatedhq/compatibility-actions/create-release@v1
111+
uses: ./create-release
112112
with:
113113
app-slug: ${{ inputs.app-slug }}
114114
api-token: ${{ inputs.api-token }}
115115
yaml-dir: ${{ inputs.yaml-dir }}
116-
chart: ${{ inputs.chart }}
116+
chart: ${{ inputs.chart }}
117117
- name: 'Create Customer'
118118
id: 'create-customer'
119-
uses: replicatedhq/compatibility-actions/create-customer@v1
119+
uses: ./create-customer
120120
with:
121121
app-slug: ${{ inputs.app-slug }}
122122
api-token: ${{ inputs.api-token }}
@@ -127,7 +127,7 @@ runs:
127127
channel-slug: ${{ steps.create-release.outputs.channel-slug }}
128128
- name: Create Cluster
129129
id: create-cluster
130-
uses: replicatedhq/compatibility-actions/create-cluster@v1
130+
uses: ./create-cluster
131131
with:
132132
api-token: ${{ inputs.api-token }}
133133
kubernetes-distribution: ${{ inputs.kubernetes-distribution }}
@@ -145,7 +145,7 @@ runs:
145145
kubeconfig-path: ${{ inputs.kubeconfig-path || '' }}
146146
export-kubeconfig: ${{ inputs.export-kubeconfig || false }}
147147
- name: Deploy the app with Helm
148-
uses: replicatedhq/compatibility-actions/helm-install@v1
148+
uses: ./helm-install
149149
if: ${{ inputs.chart != '' }}
150150
with:
151151
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
@@ -159,7 +159,7 @@ runs:
159159
run-preflights: ${{ inputs.helm-run-preflights }}
160160
- name: Deploy the app with KOTS
161161
if: ${{ inputs.yaml-dir != '' }}
162-
uses: replicatedhq/compatibility-actions/kots-install@v1
162+
uses: ./kots-install
163163
with:
164164
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
165165
app-slug: ${{ inputs.app-slug }}/test-channel

0 commit comments

Comments
 (0)