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 <yardenshoham@noreply.gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-committed-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
techknowlogick 2023-04-15 04:21:00 +08:00 committed by techknowlogick
parent d8bb352765
commit 0861260c5d
2 changed files with 36 additions and 47 deletions

View File

@ -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 .

View File

@ -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