Skip to content

Commit e266cd5

Browse files
committed
tests(helm): use built images output for values
Signed-off-by: Emilien Escalle <[email protected]>
1 parent 1b3bda8 commit e266cd5

File tree

6 files changed

+148
-132
lines changed

6 files changed

+148
-132
lines changed

.github/workflows/__test-action-helm-test-chart.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ jobs:
4242
with:
4343
check-diff-only: false
4444
helm-set: |
45-
image.tag=0.1.0
45+
image.tag=${{ fromJson(needs.build-test-images.outputs.built-images).application-test.tags[0] }}
46+
image.digest=${{ fromJson(needs.build-test-images.outputs.built-images).application-test.digest }}
4647
helm-repositories: |
4748
bitnami https://charts.bitnami.com/bitnami
4849
oci-registry: ghcr.io

actions/helm/generate-docs/action.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,28 @@ runs:
3838
- shell: bash
3939
id: prepare-variables
4040
run: |
41+
if [ ! -d "${{ inputs.working-directory }}" ]; then
42+
echo "The working directory '${{ inputs.working-directory }}' does not exist."
43+
exit 1
44+
fi
45+
working_directory=$(realpath "${{ inputs.working-directory }}")
46+
47+
echo "working-directory=${{ inputs.working-directory }}" >> "$GITHUB_OUTPUT"
4148
echo "working-directory-name=$(basename "${{ inputs.working-directory }}")" >> "$GITHUB_OUTPUT"
4249
4350
- uses: hoverkraft-tech/ci-github-common/actions/checkout@6857ef6d10f704e0998aa4955282f27d1b9be778 # 0.23.1
4451

4552
- uses: losisin/helm-docs-github-action@178c1a8927bcd668d487395beda342ba270895b3 # v1.6.1
4653
with:
47-
chart-search-root: ${{ inputs.working-directory }}
54+
chart-search-root: ${{ steps.prepare-variables.outputs.working-directory }}
55+
56+
- name: Prettify code
57+
uses: creyD/prettier_action@8c18391fdc98ed0d884c6345f03975edac71b8f0 # v4.6
58+
with:
59+
prettier_options: --write ${{ steps.prepare-variables.outputs.working-directory }}/**/*.md
60+
only_changed: true
61+
no_commit: true
62+
working_directory: ${{ steps.prepare-variables.outputs.working-directory }}
4863

4964
- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
5065
if: inputs.github-app-id

tests/charts/application/README.md

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,63 +6,63 @@ A Helm chart for Kubernetes
66

77
## Requirements
88

9-
| Repository | Name | Version |
10-
|------------|------|---------|
11-
| https://charts.bitnami.com/bitnami | mysql | 12.2.1 |
9+
| Repository | Name | Version |
10+
| ------------------------------------ | ----- | ------- |
11+
| <https://charts.bitnami.com/bitnami> | MySQL | 12.2.1 |
1212

1313
## Values
1414

15-
| Key | Type | Default | Description |
16-
|-----|------|---------|-------------|
17-
| affinity | object | `{}` | |
18-
| application.dbConnection | string | `"mysql"` | |
19-
| application.dbDatabase | string | `"test"` | |
20-
| application.dbHost | string | `"mysql"` | |
21-
| application.dbPassword | string | `"test"` | |
22-
| application.dbPort | int | `3306` | |
23-
| application.dbUsername | string | `"test"` | |
24-
| autoscaling.enabled | bool | `false` | |
25-
| autoscaling.maxReplicas | int | `100` | |
26-
| autoscaling.minReplicas | int | `1` | |
27-
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
28-
| fullnameOverride | string | `""` | |
29-
| image.digest | string | `"sha256:da3b65f32ea75f8041079d220b72da4f605738996256a7dc32715424cc117271"` | |
30-
| image.pullPolicy | string | `"Always"` | |
31-
| image.registry | string | `"ghcr.io"` | |
32-
| image.repository | string | `"hoverkraft-tech/ci-github-container/application-test"` | |
33-
| image.tag | string | `""` | |
34-
| imagePullSecrets | list | `[]` | |
35-
| ingress.annotations | object | `{}` | |
36-
| ingress.className | string | `""` | |
37-
| ingress.enabled | bool | `false` | |
38-
| ingress.hosts[0].host | string | `"chart-example.local"` | |
39-
| ingress.hosts[0].paths[0].path | string | `"/"` | |
40-
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
41-
| ingress.tls | list | `[]` | |
42-
| mysql.auth.database | string | `"test"` | |
43-
| mysql.auth.password | string | `"test"` | |
44-
| mysql.auth.rootPassword | string | `"root"` | |
45-
| mysql.auth.username | string | `"test"` | |
46-
| mysql.enabled | bool | `false` | |
47-
| mysql.fullnameOverride | string | `"mysql"` | |
48-
| nameOverride | string | `""` | |
49-
| nodeSelector | object | `{}` | |
50-
| podAnnotations | object | `{}` | |
51-
| podSecurityContext | object | `{}` | |
52-
| replicaCount | int | `1` | |
53-
| resources.limits.cpu | string | `"100m"` | |
54-
| resources.limits.memory | string | `"128Mi"` | |
55-
| resources.requests.cpu | string | `"100m"` | |
56-
| resources.requests.memory | string | `"128Mi"` | |
57-
| securityContext.allowPrivilegeEscalation | bool | `false` | |
58-
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
59-
| securityContext.readOnlyRootFilesystem | bool | `true` | |
60-
| securityContext.runAsNonRoot | bool | `true` | |
61-
| securityContext.runAsUser | int | `10001` | |
62-
| securityContext.seccompProfile.type | string | `"RuntimeDefault"` | |
63-
| service.port | int | `8080` | |
64-
| service.type | string | `"ClusterIP"` | |
65-
| serviceAccount.annotations | object | `{}` | |
66-
| serviceAccount.create | bool | `true` | |
67-
| serviceAccount.name | string | `""` | |
68-
| tolerations | list | `[]` | |
15+
| Key | Type | Default | Description |
16+
| ------------------------------------------ | ------ | --------------------------------------------------------------------------- | ----------- |
17+
| affinity | object | `{}` | |
18+
| application.dbConnection | string | `"mysql"` | |
19+
| application.dbDatabase | string | `"test"` | |
20+
| application.dbHost | string | `"mysql"` | |
21+
| application.dbPassword | string | `"test"` | |
22+
| application.dbPort | int | `3306` | |
23+
| application.dbUsername | string | `"test"` | |
24+
| autoscaling.enabled | bool | `false` | |
25+
| autoscaling.maxReplicas | int | `100` | |
26+
| autoscaling.minReplicas | int | `1` | |
27+
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
28+
| fullnameOverride | string | `""` | |
29+
| image.digest | string | `"sha256:da3b65f32ea75f8041079d220b72da4f605738996256a7dc32715424cc117271"` | |
30+
| image.pullPolicy | string | `"Always"` | |
31+
| image.registry | string | `"ghcr.io"` | |
32+
| image.repository | string | `"hoverkraft-tech/ci-github-container/application-test"` | |
33+
| image.tag | string | `""` | |
34+
| imagePullSecrets | list | `[]` | |
35+
| ingress.annotations | object | `{}` | |
36+
| ingress.className | string | `""` | |
37+
| ingress.enabled | bool | `false` | |
38+
| ingress.hosts[0].host | string | `"chart-example.local"` | |
39+
| ingress.hosts[0].paths[0].path | string | `"/"` | |
40+
| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
41+
| ingress.tls | list | `[]` | |
42+
| mysql.auth.database | string | `"test"` | |
43+
| mysql.auth.password | string | `"test"` | |
44+
| mysql.auth.rootPassword | string | `"root"` | |
45+
| mysql.auth.username | string | `"test"` | |
46+
| mysql.enabled | bool | `false` | |
47+
| mysql.fullnameOverride | string | `"mysql"` | |
48+
| nameOverride | string | `""` | |
49+
| nodeSelector | object | `{}` | |
50+
| podAnnotations | object | `{}` | |
51+
| podSecurityContext | object | `{}` | |
52+
| replicaCount | int | `1` | |
53+
| resources.limits.cpu | string | `"100m"` | |
54+
| resources.limits.memory | string | `"128Mi"` | |
55+
| resources.requests.cpu | string | `"100m"` | |
56+
| resources.requests.memory | string | `"128Mi"` | |
57+
| securityContext.allowPrivilegeEscalation | bool | `false` | |
58+
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
59+
| securityContext.readOnlyRootFilesystem | bool | `true` | |
60+
| securityContext.runAsNonRoot | bool | `true` | |
61+
| securityContext.runAsUser | int | `10001` | |
62+
| securityContext.seccompProfile.type | string | `"RuntimeDefault"` | |
63+
| service.port | int | `8080` | |
64+
| service.type | string | `"ClusterIP"` | |
65+
| serviceAccount.annotations | object | `{}` | |
66+
| serviceAccount.create | bool | `true` | |
67+
| serviceAccount.name | string | `""` | |
68+
| tolerations | list | `[]` | |

tests/charts/application/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ image:
1919
registry: "ghcr.io"
2020
repository: "hoverkraft-tech/ci-github-container/application-test"
2121
tag: ""
22-
digest: "sha256:da3b65f32ea75f8041079d220b72da4f605738996256a7dc32715424cc117271"
22+
digest: "sha256:0000000000000000000000000000000000000000000000000000000000000000"
2323

2424
imagePullSecrets: []
2525

tests/charts/umbrella-application/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ An umbrella Helm chart for Kubernetes
66

77
## Requirements
88

9-
| Repository | Name | Version |
10-
|------------|------|---------|
11-
| file://./charts/app | app | 0.0.0 |
12-
| https://charts.bitnami.com/bitnami | database(mysql) | 12.2.1 |
9+
| Repository | Name | Version |
10+
| ------------------------------------ | --------------- | ------- |
11+
| file://./charts/app | app | 0.0.0 |
12+
| <https://charts.bitnami.com/bitnami> | database(MySQL) | 12.2.1 |
1313

1414
## Values
1515

16-
| Key | Type | Default | Description |
17-
|-----|------|---------|-------------|
18-
| app.enabled | bool | `true` | |
19-
| database.auth.database | string | `"test-umbrella-application"` | |
20-
| database.auth.username | string | `"test-umbrella-application"` | |
21-
| database.enabled | bool | `true` | |
22-
| database.fullnameOverride | string | `"database"` | |
23-
| global.fullnameOverride | string | `""` | |
24-
| global.nameOverride | string | `""` | |
16+
| Key | Type | Default | Description |
17+
| ------------------------- | ------ | ----------------------------- | ----------- |
18+
| app.enabled | bool | `true` | |
19+
| database.auth.database | string | `"test-umbrella-application"` | |
20+
| database.auth.username | string | `"test-umbrella-application"` | |
21+
| database.enabled | bool | `true` | |
22+
| database.fullnameOverride | string | `"database"` | |
23+
| global.fullnameOverride | string | `""` | |
24+
| global.nameOverride | string | `""` | |

0 commit comments

Comments
 (0)