Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add pipeline for lint and unit tests #63

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 .