Skip to content

Commit 2f0e9db

Browse files
authored
Merge pull request #344: CI: Reorganize and rename GH and Circle workflows
2 parents 42b443c + 48a30ff commit 2f0e9db

File tree

6 files changed

+120
-153
lines changed

6 files changed

+120
-153
lines changed

.circleci/config.yml

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,8 @@ orbs:
1010
minikube: ccpgames/[email protected]
1111

1212
jobs:
13-
# Run Helm Lint checks
14-
helm-lint:
15-
working_directory: ~/stackstorm-ha
16-
docker:
17-
- image: lachlanevenson/k8s-helm:v3.5.3
18-
steps:
19-
- checkout
20-
- run:
21-
name: Prepare Helm
22-
command: |
23-
set -x
24-
helm dependency update
25-
- run:
26-
name: Helm Lint Check
27-
command: helm lint
28-
- run:
29-
name: Helm template
30-
command: |
31-
mkdir -p community
32-
helm template --output-dir community .
33-
- persist_to_workspace:
34-
root: ~/stackstorm-ha/
35-
paths:
36-
- community
37-
38-
# Run Kubernetes lint checks
39-
k8s-lint:
40-
docker:
41-
- image: garethr/kubeval
42-
steps:
43-
- attach_workspace:
44-
at: .
45-
- run:
46-
name: K8s Kubeval Lint Check
47-
command: kubeval $(find . -type f)
48-
working_directory: community/stackstorm-ha/templates/
49-
5013
# Spin up minikube K8s cluster and run Helm chart & e2e tests on it
51-
helm-e2e:
14+
e2e-minikube:
5215
# 'large' 4 vCPUs & 15GB RAM CircleCI machine executor
5316
# required to deploy heavy 'stackstorm-ha' Helm release with RabbitMQ, MongoDB, Redis clusters and 25+ st2 Pods.
5417
# https://circleci.com/docs/2.0/configuration-reference/#machine-executor-linux
@@ -99,27 +62,13 @@ jobs:
9962

10063
workflows:
10164
version: 2
102-
helm:
65+
e2e:
10366
jobs:
104-
- helm-lint
105-
- k8s-lint:
106-
requires:
107-
- helm-lint
108-
- helm-e2e:
109-
requires:
110-
- helm-lint
111-
- k8s-lint
67+
- e2e-minikube
11268
# Run periodic nightly Helm tests to ensure there are no regressions
113-
helm-nightly:
69+
e2e-nightly:
11470
jobs:
115-
- helm-lint
116-
- k8s-lint:
117-
requires:
118-
- helm-lint
119-
- helm-e2e:
120-
requires:
121-
- helm-lint
122-
- k8s-lint
71+
- e2e-minikube
12372
triggers:
12473
- schedule:
12574
cron: "0 1 * * *"

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

Lines changed: 4 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint & E2E Tests (Experimental)
1+
name: E2E Tests
22

33
on:
44
pull_request:
@@ -13,57 +13,8 @@ on:
1313
workflow_dispatch:
1414

1515
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]
16+
k3s:
17+
name: "k3s (experimental)"
6718
runs-on: ubuntu-22.04
6819
# NOTE: Just a thought in case the timeouts fail; might not be
6920
# necessary, but might not hurt either, would vary based on the
@@ -74,6 +25,7 @@ jobs:
7425
max-parallel: 1
7526
matrix:
7627
# TODO: Document which versions we support and cover them.
28+
# https://github.com/StackStorm/stackstorm-k8s/issues/342
7729
k3s-channel:
7830
- "v1.25.4+k3s1"
7931
steps:

.github/workflows/lint.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Lint
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

.github/workflows/unit-tests.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/unit.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
schedule:
12+
- cron: "0 1 * * *"
13+
workflow_dispatch:
14+
15+
jobs:
16+
helm-unittest:
17+
runs-on: ubuntu-22.04
18+
# strategy:
19+
# matrix:
20+
# Relevant tools installed by default on ubuntu 20.04:
21+
# - helm 3.8.0
22+
# - jq 1.6
23+
# - kind 0.11.1
24+
# - kubectl 1.23.3
25+
# - minikube 1.25.1
26+
# - python 3.8.10
27+
# - yamllint 1.26.3
28+
# - yq 4.19.1
29+
# see: https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
30+
31+
steps:
32+
- uses: actions/checkout@v2
33+
34+
- name: Install helm-unittest
35+
# We should periodically check to see if another fork has taken over maintenance,
36+
# as the de-facto "best" fork has changed several times over the years.
37+
run: |
38+
helm plugin install https://github.com/quintush/helm-unittest
39+
40+
- name: Install chart dependencies
41+
run: |
42+
helm dependency update
43+
44+
- name: Run helm-unittest
45+
# by default looks for tests/*_test.yaml
46+
run: |
47+
helm unittest --color --helm3 -f 'tests/unit/*_test.yaml' .

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+
* Reorganizing and renaming the CI workflows and jobs. (#344) (by @mamercad)
45
* Add support for providing `ingressClassName`. (#336) (by @mamercad)
56
* Add an experimental GitHu/K3s Lint and End-to-End testing workflow. (#243) (by @mamercad)
67
* Set `st2client` resources by `values.yaml`. (#337) (by @mamercad)

0 commit comments

Comments
 (0)