Skip to content

Commit

Permalink
Merge pull request #341 from mamercad/e2e-in-gha
Browse files Browse the repository at this point in the history
Add K3s End-to-End Workflow in GitHub (Experimental)
  • Loading branch information
cognifloyd authored Dec 20, 2022
2 parents b45c859 + 50edc90 commit e843498
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 0 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/lint-and-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Lint & E2E Tests (Experimental)

on:
pull_request:
types:
- opened
- synchronize
push:
branches:
- master
schedule:
- cron: "0 1 * * *"
workflow_dispatch:

jobs:
helm-lint:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Update stackstorm-ha chart dependencies
run: |
set -x
helm dependency update
- name: Helm lint
run: |
helm lint
- name: Cache community
id: cache-community
uses: actions/cache@v3
with:
path: community
key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }}

- name: Helm template
if: steps.cache-community.outputs.cache-hit != 'true'
shell: bash
run: |
helm template --output-dir community .
k8s-lint:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: [helm-lint]
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Cache community
id: cache-community
uses: actions/cache@v3
with:
path: community
key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }}

- name: Kubernetes kubeval lint
uses: instrumenta/kubeval-action@master
with:
files: community

helm-e2e:
needs: [k8s-lint]
runs-on: ubuntu-22.04
# NOTE: Just a thought in case the timeouts fail; might not be
# necessary, but might not hurt either, would vary based on the
# size of the testing matrix, too.
timeout-minutes: 30
strategy:
fail-fast: false
max-parallel: 1
matrix:
# TODO: Document which versions we support and cover them.
k3s-channel:
- "v1.25.4+k3s1"
steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Set up K3s
id: k3s
uses: jupyterhub/action-k3s-helm@v3
with:
k3s-channel: ${{ matrix.k3s-channel }}

- name: Update stackstorm-ha chart dependencies
run: |
set -x
helm dependency update
- name: Helm install
run: |
helm install --timeout 10m0s --debug --wait \
--name-template stackstorm-ha .
- name: Helm test
run: |
helm test stackstorm-ha
- name: Helm upgrade with RBAC enabled
run: |
helm upgrade --set st2.rbac.enabled=true \
--timeout 5m0s --debug --wait stackstorm-ha .
- name: Helm test
run: |
helm test stackstorm-ha
- name: Show all Kubernetes resources
if: ${{ always() }}
run: |
kubectl get all
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## In Development
* Add an experimental GitHu/K3s Lint and End-to-End testing workflow. (#243) (by @mamercad)
* Set `st2client` resources by `values.yaml`. (#337) (by @mamercad)
* Switch to the official `bats` Docker image for e2e tests. (#338)
* Temporary workaround for #311 to use previous bitnami index from: https://github.com/bitnami/charts/issues/10539 (#312 #318) (by @0xhaven)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# `stackstorm-ha` Helm Chart
[![Build Status](https://circleci.com/gh/StackStorm/stackstorm-k8s/tree/master.svg?style=shield)](https://circleci.com/gh/StackStorm/stackstorm-k8s)
[![Build Status (Experimental)](https://github.com/StackStorm/stackstorm-k8s/actions/workflows/lint-and-e2e.yaml/badge.svg)](https://github.com/StackStorm/stackstorm-k8s/actions/workflows/lint-and-e2e.yaml)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/stackstorm-ha)](https://artifacthub.io/packages/helm/stackstorm/stackstorm-ha)

K8s Helm Chart for running StackStorm cluster in HA mode.
Expand Down

0 comments on commit e843498

Please sign in to comment.