Skip to content

Commit

Permalink
ci: add pipeline for lint and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuruyia committed Nov 21, 2023
1 parent 24efd2c commit 1dcb084
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/actions/setup_helm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Setup Helm

inputs:
helm-version:
description: The version of Helm to setup
default: v3.12.0
required: false
type: string

runs:
using: "composite"
steps:
- name: Install Helm
uses: azure/setup-helm@v3
id: install-helm
with:
version: ${{ inputs.helm-version }}

- name: Add and update repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add passbolt-library https://download.passbolt.com/charts/passbolt-library
helm repo update
shell: bash

- name: Build chart dependencies
run: helm dependency build
shell: bash
40 changes: 40 additions & 0 deletions .github/workflows/push_pr_main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Push & PR to the main branch

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Helm
uses: ./.github/actions/setup_helm

- name: Run linter
run: helm lint

unit-test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Helm
uses: ./.github/actions/setup_helm

- name: Install Helm unit test plugin
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git

- name: Run unit tests
run: helm unittest .

0 comments on commit 1dcb084

Please sign in to comment.