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

Add K3s End-to-End Workflow in GitHub (Experimental) #341

Merged
merged 5 commits into from
Dec 20, 2022
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
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