From 25500d7ca233b43b7ec3bf6c557135763b330541 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sat, 1 Apr 2023 19:18:17 +0800 Subject: [PATCH 01/12] Ignore `Chart.lock` for formatters/linters (#424) This might hopefully help with the formatting issues around `Chart.lock`. Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/424 Reviewed-by: justusbunsi Co-authored-by: pat-s Co-committed-by: pat-s --- .markdownlintignore | 1 + .prettierignore | 1 + Chart.lock | 12 ++++++------ 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .prettierignore diff --git a/.markdownlintignore b/.markdownlintignore index 5922fa5..0ba7dcd 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,3 +1,4 @@ .gitea/ node_modules/ charts/ +Chart.lock \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..fafeafa --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +Chart.lock \ No newline at end of file diff --git a/Chart.lock b/Chart.lock index 44f821e..59b0519 100644 --- a/Chart.lock +++ b/Chart.lock @@ -1,9 +1,9 @@ dependencies: - - name: memcached - repository: oci://registry-1.docker.io/bitnamicharts - version: 6.3.13 - - name: postgresql - repository: oci://registry-1.docker.io/bitnamicharts - version: 12.2.6 +- name: memcached + repository: oci://registry-1.docker.io/bitnamicharts + version: 6.3.13 +- name: postgresql + repository: oci://registry-1.docker.io/bitnamicharts + version: 12.2.6 digest: sha256:7a37054b0ae841314b1e309fec6f1edc0f22f77161ee915ebfb1ce011457884c generated: "2023-03-28T21:20:51.230043+02:00" From 00395e79b039599bab748e11034063591676bc01 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sat, 1 Apr 2023 19:35:11 +0800 Subject: [PATCH 02/12] Add resource specs to init container (#423) Supersedes stalled #362 I opted for defining `requests` while leaving `limits` open. This might help for scheduling without restricting performance during init. Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/423 Reviewed-by: justusbunsi Co-authored-by: pat-s Co-committed-by: pat-s --- README.md | 9 ++++++--- templates/gitea/statefulset.yaml | 8 ++++++++ values.yaml | 10 ++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de3d5de..f7b0ed9 100644 --- a/README.md +++ b/README.md @@ -696,9 +696,12 @@ gitea: ### Init -| Name | Description | Value | -| --------------- | --------------------------------------------------------------------- | ----- | -| `initPreScript` | Bash shell script copied verbatim to the start of the init-container. | `""` | +| Name | Description | Value | +| ------------------------------------------ | ------------------------------------------------------------------------------------ | ------- | +| `initPreScript` | Bash shell script copied verbatim to the start of the init-container. | `""` | +| `initContainers.resources.limits` | initContainers.limits Kubernetes resource limits for init containers | `{}` | +| `initContainers.resources.requests.cpu` | initContainers.requests.cpu Kubernetes cpu resource limits for init containers | `100m` | +| `initContainers.resources.requests.memory` | initContainers.requests.memory Kubernetes memory resource limits for init containers | `128Mi` | ### Signing diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index 6394e9a..71818d1 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -76,6 +76,8 @@ spec: {{- include "gitea.init-additional-mounts" . | nindent 12 }} securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }} + resources: + {{- toYaml .Values.initContainers.resources | nindent 12 }} - name: init-app-ini image: "{{ include "gitea.image" . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} @@ -114,6 +116,8 @@ spec: {{- include "gitea.init-additional-mounts" . | nindent 12 }} securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }} + resources: + {{- toYaml .Values.initContainers.resources | nindent 12 }} {{- if .Values.signing.enabled }} - name: configure-gpg image: "{{ include "gitea.image" . }}" @@ -143,6 +147,8 @@ spec: {{- if .Values.extraVolumeMounts }} {{- toYaml .Values.extraVolumeMounts | nindent 12 }} {{- end }} + resources: + {{- toYaml .Values.initContainers.resources | nindent 12 }} {{- end }} - name: configure-gitea image: "{{ include "gitea.image" . }}" @@ -232,6 +238,8 @@ spec: subPath: {{ .Values.persistence.subPath }} {{- end }} {{- include "gitea.init-additional-mounts" . | nindent 12 }} + resources: + {{- toYaml .Values.initContainers.resources | nindent 12 }} terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }} containers: - name: {{ .Chart.Name }} diff --git a/values.yaml b/values.yaml index 086d06c..c07676e 100644 --- a/values.yaml +++ b/values.yaml @@ -255,6 +255,16 @@ initPreScript: "" # chown -R git:git /data/git/.postgresql/ # chmod 400 /data/git/.postgresql/postgresql.key +## @param initContainers.resources.limits initContainers.limits Kubernetes resource limits for init containers +## @param initContainers.resources.requests.cpu initContainers.requests.cpu Kubernetes cpu resource limits for init containers +## @param initContainers.resources.requests.memory initContainers.requests.memory Kubernetes memory resource limits for init containers +initContainers: + resources: + limits: {} + requests: + cpu: 100m + memory: 128Mi + # Configure commit/action signing prerequisites ## @section Signing # From bfaf822a367f94284fb5eae82eb89dd04680e902 Mon Sep 17 00:00:00 2001 From: Casey Buto Date: Fri, 7 Apr 2023 18:58:34 +0800 Subject: [PATCH 03/12] feat: Add support for setting priorityClassName (#430) ### Description of the change Adds support for setting priorityClassName on the Gitea pod. ### Benefits Users can take advantage of https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/ with Gitea. ### Applicable issues - fixes #429 ### Checklist - [x] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm) Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/430 Reviewed-by: pat-s Co-authored-by: Casey Buto Co-committed-by: Casey Buto --- README.md | 1 + templates/gitea/statefulset.yaml | 3 +++ values.yaml | 3 +++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index f7b0ed9..1b00460 100644 --- a/README.md +++ b/README.md @@ -672,6 +672,7 @@ gitea: | `tolerations` | Tolerations for the statefulset | `[]` | | `affinity` | Affinity for the statefulset | `{}` | | `dnsConfig` | dnsConfig for the statefulset | `{}` | +| `priorityClassName` | priorityClassName for the statefulset | `""` | | `statefulset.env` | Additional environment variables to pass to containers | `[]` | | `statefulset.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` | | `statefulset.labels` | Labels for the statefulset | `{}` | diff --git a/templates/gitea/statefulset.yaml b/templates/gitea/statefulset.yaml index 71818d1..b11813b 100644 --- a/templates/gitea/statefulset.yaml +++ b/templates/gitea/statefulset.yaml @@ -39,6 +39,9 @@ spec: {{- if .Values.schedulerName }} schedulerName: "{{ .Values.schedulerName }}" {{- end }} + {{- if .Values.priorityClassName }} + priorityClassName: "{{ .Values.priorityClassName }}" + {{- end }} {{- include "gitea.images.pullSecrets" . | nindent 6 }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/values.yaml b/values.yaml index c07676e..de358c6 100644 --- a/values.yaml +++ b/values.yaml @@ -189,6 +189,9 @@ affinity: {} ## @param dnsConfig dnsConfig for the statefulset dnsConfig: {} +## @param priorityClassName priorityClassName for the statefulset +priorityClassName: "" + ## @param statefulset.env Additional environment variables to pass to containers ## @param statefulset.terminationGracePeriodSeconds How long to wait until forcefully kill the pod ## @param statefulset.labels Labels for the statefulset From c0b2fdf8fad60dce73d82d3c68136377b292a13e Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 14 Apr 2023 02:21:21 +0800 Subject: [PATCH 04/12] Remove discord webhook (#435) Broken since a long time and probably not used by anyone Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/435 Reviewed-by: techknowlogick Co-authored-by: pat-s Co-committed-by: pat-s --- .drone.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 93098ca..bee26f1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -46,19 +46,6 @@ steps: commands: - yamllint -f colored . - - name: discord - pull: always - image: appleboy/drone-discord:1.2.4 - environment: - DISCORD_WEBHOOK_ID: - from_secret: discord_webhook_id - DISCORD_WEBHOOK_TOKEN: - from_secret: discord_webhook_token - when: - status: - - changed - - failure - --- kind: pipeline type: docker From a9779c97249837bfd1ef3bf35454e3cdac2677c4 Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 14 Apr 2023 02:25:37 +0800 Subject: [PATCH 05/12] Bump to 1.19.1 (#433) Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/433 Co-authored-by: pat-s Co-committed-by: pat-s --- Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chart.yaml b/Chart.yaml index 2c3ac2e..7b9134c 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -3,7 +3,7 @@ name: gitea description: Gitea Helm chart for Kubernetes type: application version: 0.0.0 -appVersion: 1.19.0 +appVersion: 1.19.1 icon: https://docs.gitea.io/images/gitea.png keywords: From 9f0b65f38661eabfa65b25256809ffb16967623c Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 14 Apr 2023 14:45:37 +0800 Subject: [PATCH 06/12] Fix unittests (#434) Unclear why it only appeared now and not earlier. Co-authored-by: justusbunsi Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/434 Reviewed-by: justusbunsi Co-authored-by: pat-s Co-committed-by: pat-s --- .drone.yml | 2 +- unittests/init/init_directory_structure.sh.yaml | 8 ++++++++ unittests/statefulset/signing-disabled.yaml | 4 ++-- unittests/statefulset/signing-enabled.yaml | 3 +++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index bee26f1..95a7ff1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,7 +28,7 @@ steps: image: alpine:3.17 commands: - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash - - helm plugin install https://github.com/helm-unittest/helm-unittest + - helm plugin install --version 0.3.1 https://github.com/helm-unittest/helm-unittest - helm dependency update - make unittests diff --git a/unittests/init/init_directory_structure.sh.yaml b/unittests/init/init_directory_structure.sh.yaml index 3b03f66..ddfa981 100644 --- a/unittests/init/init_directory_structure.sh.yaml +++ b/unittests/init/init_directory_structure.sh.yaml @@ -8,6 +8,10 @@ tests: - it: runs gpg in batch mode set: signing.enabled: true + signing.privateKey: |- + -----BEGIN PGP PRIVATE KEY BLOCK----- + {placeholder} + -----END PGP PRIVATE KEY BLOCK----- asserts: - equal: path: stringData["configure_gpg_environment.sh"] @@ -38,6 +42,10 @@ tests: - it: adds gpg script block for enabled signing set: signing.enabled: true + signing.privateKey: |- + -----BEGIN PGP PRIVATE KEY BLOCK----- + {placeholder} + -----END PGP PRIVATE KEY BLOCK----- asserts: - equal: path: stringData["init_directory_structure.sh"] diff --git a/unittests/statefulset/signing-disabled.yaml b/unittests/statefulset/signing-disabled.yaml index 4f9f2ce..cc7bad4 100644 --- a/unittests/statefulset/signing-disabled.yaml +++ b/unittests/statefulset/signing-disabled.yaml @@ -17,9 +17,9 @@ tests: - it: skips gpg env in `init-directories` init container template: templates/gitea/statefulset.yaml set: - signing.enabled: true + signing.enabled: false asserts: - - contains: + - notContains: path: spec.template.spec.initContainers[0].env content: name: GNUPGHOME diff --git a/unittests/statefulset/signing-enabled.yaml b/unittests/statefulset/signing-enabled.yaml index ecb237f..0d68bd9 100644 --- a/unittests/statefulset/signing-enabled.yaml +++ b/unittests/statefulset/signing-enabled.yaml @@ -42,6 +42,7 @@ tests: template: templates/gitea/statefulset.yaml set: signing.enabled: true + signing.existingSecret: "custom-gpg-secret" asserts: - contains: path: spec.template.spec.initContainers[0].env @@ -52,6 +53,7 @@ tests: template: templates/gitea/statefulset.yaml set: signing.enabled: true + signing.existingSecret: "custom-gpg-secret" asserts: - contains: path: spec.template.spec.containers[0].env @@ -63,6 +65,7 @@ tests: set: signing: enabled: true + existingSecret: "gitea-unittests-gpg-key" asserts: - contains: path: spec.template.spec.volumes From 7434556b37a4a5808841d53c763a28afaff9b0bd Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 14 Apr 2023 14:54:34 +0800 Subject: [PATCH 07/12] Use Gitea Actions for release publishing (#436) Co-authored-by: pat-s Co-authored-by: pat-s Co-authored-by: Lunny Xiao Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/436 Reviewed-by: pat-s Co-authored-by: techknowlogick Co-committed-by: techknowlogick --- .drone.yml | 49 ---------------------------- .gitea/workflows/release-version.yml | 38 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 49 deletions(-) create mode 100644 .gitea/workflows/release-version.yml diff --git a/.drone.yml b/.drone.yml index 95a7ff1..ba6ca11 100644 --- a/.drone.yml +++ b/.drone.yml @@ -45,52 +45,3 @@ steps: image: cytopia/yamllint:alpine-1 commands: - yamllint -f colored . - ---- -kind: pipeline -type: docker -name: release-version - -platform: - os: linux - arch: arm64 - -trigger: - event: - - tag - -steps: - - name: generate-chart - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - - apk add --no-cache curl - - helm dependency update - - helm package --version "${DRONE_TAG##v}" ./ - - mkdir gitea - - mv gitea*.tgz gitea/ - - curl -L -o gitea/index.yaml https://dl.gitea.io/charts/index.yaml - - helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml - - - name: upload-chart - pull: always - image: plugins/s3:latest - settings: - acl: - from_secret: aws_s3_acl - region: - from_secret: aws_s3_region - bucket: - from_secret: aws_s3_bucket - endpoint: - from_secret: aws_s3_endpoint - path_style: - from_secret: aws_s3_path_style - access_key: - from_secret: aws_access_key_id - secret_key: - from_secret: aws_secret_access_key - source: gitea/* - target: /charts - strip_prefix: gitea/ diff --git a/.gitea/workflows/release-version.yml b/.gitea/workflows/release-version.yml new file mode 100644 index 0000000..2711ab3 --- /dev/null +++ b/.gitea/workflows/release-version.yml @@ -0,0 +1,38 @@ +name: generate-chart + +on: + push: + tags: + - "*" + +jobs: + generate-chart-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: install tools + run: | + apt update -y + apt install -y curl helm python python3-pip + pip install awscli + - name: package chart + run: | + helm dependency update + helm package --version "${GITHUB_REF#refs/tags/v}" ./ + mkdir gitea + mv gitea*.tgz gitea/ + curl -L -o gitea/index.yaml https://dl.gitea.com/charts/index.yaml + helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml + - name: aws credential configure + uses: https://github.com/aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} + aws-region: ${{ secrets.AWS_REGION }} + - name: install aws cli + run: | + apt update -y && + pip install awscli + - name: Copy files to S3 and clear cache + run: | + aws s3 sync gitea/ s3://${{ secrets.AWS_S3_BUCKET}}/charts/ From e768a6acdcfb41f3c3b229566db5897cfb3e3db1 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 14 Apr 2023 15:49:18 +0800 Subject: [PATCH 08/12] Fix release tag ci --- .gitea/workflows/release-version.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/release-version.yml b/.gitea/workflows/release-version.yml index 2711ab3..f82cd96 100644 --- a/.gitea/workflows/release-version.yml +++ b/.gitea/workflows/release-version.yml @@ -13,7 +13,11 @@ jobs: - name: install tools run: | apt update -y - apt install -y curl helm python python3-pip + apt install -y curl + curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list + apt update -y + apt install python helm python3-pip apt-transport-https pip install awscli - name: package chart run: | From 95076eb11fc4385c081ff8cc961ed97df0bc6525 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 14 Apr 2023 16:08:04 +0800 Subject: [PATCH 09/12] Fix yaml lint --- .gitea/workflows/release-version.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release-version.yml b/.gitea/workflows/release-version.yml index f82cd96..4c03050 100644 --- a/.gitea/workflows/release-version.yml +++ b/.gitea/workflows/release-version.yml @@ -13,11 +13,11 @@ jobs: - name: install tools run: | apt update -y - apt install -y curl + apt install -y curl curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list apt update -y - apt install python helm python3-pip apt-transport-https + apt install python helm python3-pip apt-transport-https pip install awscli - name: package chart run: | From 76e47ef6f037967bddfc21d5d5ba77b2085dfd9b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 14 Apr 2023 18:19:41 +0800 Subject: [PATCH 10/12] Add -y to fix apt install on ci --- .gitea/workflows/release-version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/release-version.yml b/.gitea/workflows/release-version.yml index 4c03050..c2efebd 100644 --- a/.gitea/workflows/release-version.yml +++ b/.gitea/workflows/release-version.yml @@ -17,7 +17,7 @@ jobs: curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list apt update -y - apt install python helm python3-pip apt-transport-https + apt install -y python helm python3-pip apt-transport-https pip install awscli - name: package chart run: | From d8bb3527654e80592e32af808dbbd48e680420d0 Mon Sep 17 00:00:00 2001 From: pat-s Date: Fri, 14 Apr 2023 21:06:43 +0800 Subject: [PATCH 11/12] Fix aws secrets (#438) @lunny It still looks like that the IAM user does not have enough permissions for the S3 sync operation. Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/438 Reviewed-by: Lunny Xiao Co-authored-by: pat-s Co-committed-by: pat-s --- .gitea/workflows/release-version.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release-version.yml b/.gitea/workflows/release-version.yml index c2efebd..b30ee7f 100644 --- a/.gitea/workflows/release-version.yml +++ b/.gitea/workflows/release-version.yml @@ -28,10 +28,10 @@ jobs: curl -L -o gitea/index.yaml https://dl.gitea.com/charts/index.yaml helm repo index gitea/ --url https://dl.gitea.io/charts --merge gitea/index.yaml - name: aws credential configure - uses: https://github.com/aws-actions/configure-aws-credentials@v1 + uses: https://github.com/aws-actions/configure-aws-credentials@v2 with: aws-access-key-id: ${{ secrets.AWS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.AWS_REGION }} - name: install aws cli run: | From 0861260c5d9902e6f36c65bbf7b6f1008c3658bc Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sat, 15 Apr 2023 04:21:00 +0800 Subject: [PATCH 12/12] update to use actions for testing PRs (#439) Run PR tests using Gitea Actions Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/439 Reviewed-by: yardenshoham Co-authored-by: techknowlogick Co-committed-by: techknowlogick --- .drone.yml | 47 ------------------------------------ .gitea/workflows/test-pr.yml | 36 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 47 deletions(-) delete mode 100644 .drone.yml create mode 100644 .gitea/workflows/test-pr.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index ba6ca11..0000000 --- a/.drone.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -kind: pipeline -type: docker -name: lint - -platform: - os: linux - arch: arm64 - -steps: - - name: helm lint - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - - helm lint - - - name: helm template - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing helm - - helm dependency update - - helm template --debug gitea-helm . - - - name: helm unittests - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make helm git bash - - helm plugin install --version 0.3.1 https://github.com/helm-unittest/helm-unittest - - helm dependency update - - make unittests - - - name: verify readme - pull: always - image: alpine:3.17 - commands: - - apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing make npm git - - make readme - - git diff --exit-code --name-only README.md - - - name: yaml lint - pull: always - image: cytopia/yamllint:alpine-1 - commands: - - yamllint -f colored . diff --git a/.gitea/workflows/test-pr.yml b/.gitea/workflows/test-pr.yml new file mode 100644 index 0000000..ea06564 --- /dev/null +++ b/.gitea/workflows/test-pr.yml @@ -0,0 +1,36 @@ +name: check-and-test + +on: + - pull_request + +jobs: + check-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: install tools + run: | + apt update -y + apt install -y curl make + curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list + apt update -y + apt install -y helm python3-pip + pip install yamllint + - name: dependency update + run: helm dependency update + - name: lint + run: helm lint + - name: template + run: | + helm template --debug gitea-helm . + - name: unit tests + run: | + helm plugin install --version 0.3.1 https://github.com/helm-unittest/helm-unittest + make unittests + - name: verify readme + run: | + make readme + git diff --exit-code --name-only README.md + - name: yaml lint + uses: https://github.com/ibiqlik/action-yamllint@v3