Skip to content

Commit e843498

Browse files
authored
Merge pull request #341 from mamercad/e2e-in-gha
Add K3s End-to-End Workflow in GitHub (Experimental)
2 parents b45c859 + 50edc90 commit e843498

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

.github/workflows/lint-and-e2e.yaml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Lint & E2E Tests (Experimental)
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
push:
9+
branches:
10+
- master
11+
schedule:
12+
- cron: "0 1 * * *"
13+
workflow_dispatch:
14+
15+
jobs:
16+
helm-lint:
17+
runs-on: ubuntu-22.04
18+
timeout-minutes: 10
19+
steps:
20+
- name: Checkout source
21+
uses: actions/checkout@v3
22+
23+
- name: Update stackstorm-ha chart dependencies
24+
run: |
25+
set -x
26+
helm dependency update
27+
28+
- name: Helm lint
29+
run: |
30+
helm lint
31+
32+
- name: Cache community
33+
id: cache-community
34+
uses: actions/cache@v3
35+
with:
36+
path: community
37+
key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }}
38+
39+
- name: Helm template
40+
if: steps.cache-community.outputs.cache-hit != 'true'
41+
shell: bash
42+
run: |
43+
helm template --output-dir community .
44+
45+
k8s-lint:
46+
runs-on: ubuntu-22.04
47+
timeout-minutes: 10
48+
needs: [helm-lint]
49+
steps:
50+
- name: Checkout source
51+
uses: actions/checkout@v3
52+
53+
- name: Cache community
54+
id: cache-community
55+
uses: actions/cache@v3
56+
with:
57+
path: community
58+
key: ${{ runner.os }}-community-${{ hashFiles('conf/**', 'templates/**', 'Chart.yaml', 'values.yaml') }}
59+
60+
- name: Kubernetes kubeval lint
61+
uses: instrumenta/kubeval-action@master
62+
with:
63+
files: community
64+
65+
helm-e2e:
66+
needs: [k8s-lint]
67+
runs-on: ubuntu-22.04
68+
# NOTE: Just a thought in case the timeouts fail; might not be
69+
# necessary, but might not hurt either, would vary based on the
70+
# size of the testing matrix, too.
71+
timeout-minutes: 30
72+
strategy:
73+
fail-fast: false
74+
max-parallel: 1
75+
matrix:
76+
# TODO: Document which versions we support and cover them.
77+
k3s-channel:
78+
- "v1.25.4+k3s1"
79+
steps:
80+
- name: Checkout source
81+
uses: actions/checkout@v3
82+
83+
- name: Set up K3s
84+
id: k3s
85+
uses: jupyterhub/action-k3s-helm@v3
86+
with:
87+
k3s-channel: ${{ matrix.k3s-channel }}
88+
89+
- name: Update stackstorm-ha chart dependencies
90+
run: |
91+
set -x
92+
helm dependency update
93+
94+
- name: Helm install
95+
run: |
96+
helm install --timeout 10m0s --debug --wait \
97+
--name-template stackstorm-ha .
98+
99+
- name: Helm test
100+
run: |
101+
helm test stackstorm-ha
102+
103+
- name: Helm upgrade with RBAC enabled
104+
run: |
105+
helm upgrade --set st2.rbac.enabled=true \
106+
--timeout 5m0s --debug --wait stackstorm-ha .
107+
108+
- name: Helm test
109+
run: |
110+
helm test stackstorm-ha
111+
112+
- name: Show all Kubernetes resources
113+
if: ${{ always() }}
114+
run: |
115+
kubectl get all

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## In Development
4+
* Add an experimental GitHu/K3s Lint and End-to-End testing workflow. (#243) (by @mamercad)
45
* Set `st2client` resources by `values.yaml`. (#337) (by @mamercad)
56
* Switch to the official `bats` Docker image for e2e tests. (#338)
67
* Temporary workaround for #311 to use previous bitnami index from: https://github.com/bitnami/charts/issues/10539 (#312 #318) (by @0xhaven)

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# `stackstorm-ha` Helm Chart
22
[![Build Status](https://circleci.com/gh/StackStorm/stackstorm-k8s/tree/master.svg?style=shield)](https://circleci.com/gh/StackStorm/stackstorm-k8s)
3+
[![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)
34
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/stackstorm-ha)](https://artifacthub.io/packages/helm/stackstorm/stackstorm-ha)
45

56
K8s Helm Chart for running StackStorm cluster in HA mode.

0 commit comments

Comments
 (0)