Skip to content

Commit 1c6fcd7

Browse files
authored
chore(ci): test prepare-cluster on pr (#60)
* chore(ci): test prepare-cluster on pr * f * f * f * f * f * f * f * f
1 parent abb0f7e commit 1c6fcd7

File tree

110 files changed

+343557
-52026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+343557
-52026
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/dist/** -diff
2+
**/dist/** linguist-generated=true

.github/workflows/ci.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
1-
name: CI
1+
name: ci
22

3-
on: push
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ci-${{ github.head_ref }}
10+
cancel-in-progress: true
411

512
jobs:
613
build:
714
runs-on: ubuntu-latest
8-
permissions:
9-
# Give the default GITHUB_TOKEN write permission to commit and push the
10-
# added or changed files to the repository.
11-
contents: write
1215

1316
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: package
17-
run: make package-all
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
cache: "npm"
22+
cache-dependency-path: |
23+
**/package-lock.json
1824
19-
- name: readme
20-
run: make readme-all
25+
- name: build
26+
run: make
2127

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
28+
- name: fail if files changed
29+
run: |
30+
if ! git diff --quiet --exit-code ; then
31+
echo "Please run 'make package-all' and 'make readme-all' locally and commit the changes."
32+
exit 1
33+
fi
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: test - create-cluster
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- create-cluster/**
9+
10+
concurrency:
11+
group: test-create-cluster-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: "npm"
24+
cache-dependency-path: |
25+
**/package-lock.json
26+
27+
- name: build
28+
run: make package-create-cluster
29+
30+
- name: test create-cluster
31+
id: create-cluster
32+
uses: ./create-cluster
33+
with:
34+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
35+
kubernetes-distribution: kind
36+
timeout-minutes: 5
37+
38+
- name: remove cluster
39+
if: always()
40+
uses: replicatedhq/compatibility-actions/remove-cluster@v1
41+
continue-on-error: true # It could be that the cluster is already removed
42+
with:
43+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
44+
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: test - create-customer
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- create-customer/**
9+
10+
concurrency:
11+
group: test-create-customer-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
env:
18+
WORDPRESS_CHART_VERSION: 22.2.8
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: "npm"
26+
cache-dependency-path: |
27+
**/package-lock.json
28+
29+
- name: build
30+
run: make package-create-customer
31+
32+
- name: test create-customer
33+
id: create-customer
34+
uses: ./create-customer
35+
with:
36+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
37+
app-slug: replicated-actions-ci # from the Replicated QA team
38+
customer-name: "CI Test Customer - ${{ github.ref_name }} - ${{ github.sha }}"
39+
customer-email: ${{ github.sha }}@example.com
40+
license-type: test
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: test - create-release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- create-release/**
9+
10+
concurrency:
11+
group: test-create-release-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
env:
18+
WORDPRESS_CHART_VERSION: 22.2.8
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: "npm"
26+
cache-dependency-path: |
27+
**/package-lock.json
28+
29+
- name: build
30+
run: make package-create-release
31+
32+
- name: pull helm chart
33+
run: |
34+
helm pull oci://registry-1.docker.io/bitnamicharts/wordpress --version ${{ env.WORDPRESS_CHART_VERSION }}
35+
36+
- name: test create-release / helm
37+
id: create-release-helm
38+
uses: ./create-release
39+
with:
40+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
41+
app-slug: replicated-actions-ci # from the Replicated QA team
42+
chart: wordpress-${{ env.WORDPRESS_CHART_VERSION }}.tgz
43+
44+
- name: test create-release / kots-install
45+
id: create-release-kots-install
46+
uses: ./create-release
47+
with:
48+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
49+
app-slug: replicated-actions-ci # from the Replicated QA team
50+
yaml-dir: ./test/kots-install
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: test - helm-install
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- helm-install/**
9+
10+
concurrency:
11+
group: test-helm-install-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
env:
18+
WORDPRESS_CHART_VERSION: 22.2.8
19+
APP_SLUG: replicated-actions-ci # from the Replicated QA team
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: "npm"
27+
cache-dependency-path: |
28+
**/package-lock.json
29+
30+
- name: build
31+
run: make package-helm-install
32+
33+
- name: pull helm chart
34+
run: |
35+
helm pull oci://registry-1.docker.io/bitnamicharts/wordpress --version ${{ env.WORDPRESS_CHART_VERSION }}
36+
37+
- name: create-release
38+
id: create-release
39+
uses: replicatedhq/compatibility-actions/create-release@v1
40+
with:
41+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
42+
app-slug: ${{ env.APP_SLUG }}
43+
chart: wordpress-${{ env.WORDPRESS_CHART_VERSION }}.tgz
44+
45+
- name: create-customer
46+
id: create-customer
47+
uses: replicatedhq/compatibility-actions/create-customer@v1
48+
with:
49+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
50+
app-slug: replicated-actions-ci # from the Replicated QA team
51+
customer-name: "CI Test Customer - ${{ github.ref_name }} - ${{ github.sha }}"
52+
customer-email: ${{ github.sha }}@example.com
53+
license-type: test
54+
55+
- name: create-cluster
56+
id: create-cluster
57+
uses: replicatedhq/compatibility-actions/create-cluster@v1
58+
with:
59+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
60+
kubernetes-distribution: kind
61+
timeout-minutes: 5
62+
63+
- name: test helm-install
64+
id: helm-install
65+
uses: ./helm-install
66+
with:
67+
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
68+
helm-path: helm
69+
registry-username: ${{ github.ref_name }}@example.com
70+
registry-password: ${{ steps.create-customer.outputs.license-id }}
71+
chart: oci://registry.replicated.com/${{ env.APP_SLUG }}/release__${{ steps.create-release.outputs.release-sequence }}/wordpress
72+
name: wordpress
73+
namespace: default
74+
run-preflights: false
75+
76+
- name: remove cluster
77+
id: remove-cluster
78+
if: always()
79+
uses: replicatedhq/compatibility-actions/remove-cluster@v1
80+
continue-on-error: true # It could be that the cluster is already removed
81+
with:
82+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
83+
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: test - kots-install
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- kots-install/**
9+
10+
concurrency:
11+
group: test-kots-install-${{ github.head_ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
env:
18+
WORDPRESS_CHART_VERSION: 22.2.8
19+
APP_SLUG: replicated-actions-ci # from the Replicated QA team
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: "npm"
27+
cache-dependency-path: |
28+
**/package-lock.json
29+
30+
- name: build
31+
run: make package-kots-install
32+
33+
- name: create-release
34+
id: create-release
35+
uses: replicatedhq/compatibility-actions/create-release@v1
36+
with:
37+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
38+
app-slug: ${{ env.APP_SLUG }}
39+
yaml-dir: ./test/kots-install
40+
41+
- name: create-customer
42+
id: create-customer
43+
uses: replicatedhq/compatibility-actions/create-customer@v1
44+
with:
45+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
46+
app-slug: replicated-actions-ci # from the Replicated QA team
47+
customer-name: "CI Test Customer - ${{ github.ref_name }} - ${{ github.sha }}"
48+
customer-email: ${{ github.sha }}@example.com
49+
license-type: test
50+
51+
- name: create-cluster
52+
id: create-cluster
53+
uses: replicatedhq/compatibility-actions/create-cluster@v1
54+
with:
55+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
56+
kubernetes-distribution: kind
57+
timeout-minutes: 5
58+
59+
- name: test kots-install
60+
id: kots-install
61+
uses: ./kots-install
62+
with:
63+
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
64+
app-slug: ${{ env.APP_SLUG }}/${{ steps.create-release.outputs.channel-slug }}
65+
license-file: ${{ steps.create-customer.outputs.license-file }}
66+
app-version-label: release__${{ steps.create-release.outputs.release-sequence }}
67+
68+
- name: remove cluster
69+
id: remove-cluster
70+
if: always()
71+
uses: replicatedhq/compatibility-actions/remove-cluster@v1
72+
continue-on-error: true # It could be that the cluster is already removed
73+
with:
74+
api-token: ${{ secrets.REPLICATED_API_TOKEN }}
75+
cluster-id: ${{ steps.create-cluster.outputs.cluster-id }}

0 commit comments

Comments
 (0)