Skip to content

Commit ab26c06

Browse files
Merge pull request #1351 from porter-dev/sms/template-portercharts
feat: add test to porter charts on PR
2 parents 9d8e85a + a1b86e9 commit ab26c06

File tree

3 files changed

+218
-0
lines changed

3 files changed

+218
-0
lines changed

.github/workflows/pr_checks.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PR Checks
2+
3+
concurrency:
4+
group: ${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
pull_request:
9+
permissions:
10+
contents: read
11+
jobs:
12+
helm-template:
13+
name: Basic Helm Template
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
- name: Get changed files
20+
id: changed-files
21+
uses: tj-actions/changed-files@v41
22+
with:
23+
files: |
24+
applications/**
25+
- name: List all changed files
26+
run: |
27+
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
28+
echo "$file was changed"
29+
done
30+
31+
- name: Setup Helm
32+
if: steps.changed-files.outputs.any_changed == 'true'
33+
uses: azure/[email protected]
34+
id: install-helm
35+
36+
- name: Helm template - web
37+
if: steps.changed-files.outputs.any_changed == 'true'
38+
shell: bash
39+
run: helm template applications/web -f applications/testdata/web.yaml
40+
41+
- name: Helm template - worker
42+
if: steps.changed-files.outputs.any_changed == 'true'
43+
shell: bash
44+
run: helm template applications/worker -f applications/testdata/worker.yaml

applications/testdata/web.yaml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
autoscaling:
2+
enabled: false
3+
gpu: false
4+
maxReplicas: 10
5+
minReplicas: 1
6+
targetCPUUtilizationPercentage: 50
7+
targetGPUMemoryUtilizationRatio: 1
8+
targetGPUUtilizationPercentage: 100
9+
targetMemoryUtilizationPercentage: 50
10+
cloudsql:
11+
connectionName: ""
12+
dbPort: 0
13+
enabled: false
14+
serviceAccountJSONSecret: ""
15+
configMapRefs:
16+
- 18-aaaaaa.1
17+
container:
18+
command: ""
19+
env:
20+
normal: null
21+
port: 80
22+
deploymentStrategy:
23+
blueGreen:
24+
partnerApps:
25+
- test
26+
- test2
27+
kind: blueGreen
28+
fileSecretMounts:
29+
enabled: false
30+
mounts: null
31+
fullnameOverride: test2-test2
32+
health:
33+
livenessProbe:
34+
command: ""
35+
enabled: false
36+
initialDelaySeconds: 0
37+
path: ""
38+
timeoutSeconds: 0
39+
readinessProbe:
40+
command: ""
41+
enabled: false
42+
initialDelaySeconds: 0
43+
path: ""
44+
timeoutSeconds: 0
45+
ingress:
46+
enabled: false
47+
hosts: null
48+
tls: true
49+
wildcard: false
50+
labels:
51+
porter.run/absolute-name: test2-test2
52+
porter.run/app-id: "18"
53+
porter.run/app-instance-id: ce9f3244-93fe-4491-9c0a-337e30d834a7
54+
porter.run/app-name: test2
55+
porter.run/app-revision-id: ff416065-c468-455a-bd1c-ba2a7de2445d
56+
porter.run/deployment-target-id: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
57+
porter.run/porter-application: "true"
58+
porter.run/project-id: "10"
59+
porter.run/service-name: test2
60+
porter.run/service-type: web
61+
porter.run/tailscale-svc: "true"
62+
nodeGroups: null
63+
podDisruptionBudget:
64+
enabled: false
65+
podLabels:
66+
porter.run/absolute-name: test2-test2
67+
porter.run/app-id: "18"
68+
porter.run/app-instance-id: ce9f3244-93fe-4491-9c0a-337e30d834a7
69+
porter.run/app-name: test2
70+
porter.run/app-revision-id: ff416065-c468-455a-bd1c-ba2a7de2445d
71+
porter.run/deployment-target-id: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
72+
porter.run/porter-application: "true"
73+
porter.run/project-id: "10"
74+
porter.run/service-name: test2
75+
porter.run/service-type: web
76+
porter.run/tailscale-svc: "true"
77+
replicaCount: 1
78+
resources:
79+
limits: {}
80+
requests:
81+
cpu: "0.2"
82+
memory: 100M
83+
secretRefs:
84+
- 18-aaaaaa.1
85+
service:
86+
port: 80
87+
terminationGracePeriodSeconds: 30

applications/testdata/worker.yaml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
autoscaling:
2+
enabled: false
3+
gpu: false
4+
maxReplicas: 10
5+
minReplicas: 1
6+
targetCPUUtilizationPercentage: 50
7+
targetGPUMemoryUtilizationRatio: 1
8+
targetGPUUtilizationPercentage: 100
9+
targetMemoryUtilizationPercentage: 50
10+
cloudsql:
11+
connectionName: ""
12+
dbPort: 0
13+
enabled: false
14+
serviceAccountJSONSecret: ""
15+
configMapRefs:
16+
- 18-aaaaaa.1
17+
container:
18+
command: ""
19+
env:
20+
normal: null
21+
port: 80
22+
deploymentStrategy:
23+
blueGreen:
24+
partnerApps:
25+
- test
26+
- test2
27+
kind: blueGreen
28+
fileSecretMounts:
29+
enabled: false
30+
mounts: null
31+
fullnameOverride: test2-test2
32+
health:
33+
livenessProbe:
34+
command: ""
35+
enabled: false
36+
initialDelaySeconds: 0
37+
path: ""
38+
timeoutSeconds: 0
39+
readinessProbe:
40+
command: ""
41+
enabled: false
42+
initialDelaySeconds: 0
43+
path: ""
44+
timeoutSeconds: 0
45+
ingress:
46+
enabled: false
47+
hosts: null
48+
tls: true
49+
wildcard: false
50+
labels:
51+
porter.run/absolute-name: test2-test2
52+
porter.run/app-id: "18"
53+
porter.run/app-instance-id: ce9f3244-93fe-4491-9c0a-337e30d834a7
54+
porter.run/app-name: test2
55+
porter.run/app-revision-id: ff416065-c468-455a-bd1c-ba2a7de2445d
56+
porter.run/deployment-target-id: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
57+
porter.run/porter-application: "true"
58+
porter.run/project-id: "10"
59+
porter.run/service-name: test2
60+
porter.run/service-type: web
61+
porter.run/tailscale-svc: "true"
62+
nodeGroups: null
63+
podDisruptionBudget:
64+
enabled: false
65+
podLabels:
66+
porter.run/absolute-name: test2-test2
67+
porter.run/app-id: "18"
68+
porter.run/app-instance-id: ce9f3244-93fe-4491-9c0a-337e30d834a7
69+
porter.run/app-name: test2
70+
porter.run/app-revision-id: ff416065-c468-455a-bd1c-ba2a7de2445d
71+
porter.run/deployment-target-id: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
72+
porter.run/porter-application: "true"
73+
porter.run/project-id: "10"
74+
porter.run/service-name: test2
75+
porter.run/service-type: web
76+
porter.run/tailscale-svc: "true"
77+
replicaCount: 1
78+
resources:
79+
limits: {}
80+
requests:
81+
cpu: "0.2"
82+
memory: 100M
83+
secretRefs:
84+
- 18-aaaaaa.1
85+
service:
86+
port: 80
87+
terminationGracePeriodSeconds: 30

0 commit comments

Comments
 (0)