-
Notifications
You must be signed in to change notification settings - Fork 29
160 lines (135 loc) · 5.34 KB
/
test-chart.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
#
name: Test chart
# Trigger the workflow's on all PRs and pushes so that other contributors can
# run tests in their own forks. Avoid triggering these tests on changes to
# documentation only changes.
on:
pull_request:
paths-ignore:
- "docs/**"
- "**.md"
- ".github/workflows/*"
- "!.github/workflows/test-chart.yaml"
push:
paths-ignore:
- "docs/**"
- "**.md"
- ".github/workflows/*"
- "!.github/workflows/test-chart.yaml"
branches-ignore:
- "dependabot/**"
workflow_dispatch:
jobs:
test-chart-templates:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
pip list
helm version
- name: Generate values.schema.json from schema.yaml
run: helm-chart/tools/generate-json-schema.py
- name: Helm lint (values.yaml)
run: helm lint helm-chart/jupyterhub-ssh
- name: Helm lint --strict (values.yaml)
run: helm lint --strict helm-chart/jupyterhub-ssh
continue-on-error: true
- name: Helm lint (values.lint.yaml)
run: helm lint helm-chart/jupyterhub-ssh --values helm-chart/jupyterhub-ssh/values.lint.yaml
- name: Helm lint --strict (values.lint.yaml)
run: helm lint --strict helm-chart/jupyterhub-ssh
continue-on-error: true
- name: Helm template (values.yaml)
run: helm template helm-chart/jupyterhub-ssh --set hubUrl=http://hub:8081
- name: Helm template (values.lint.yaml)
run: helm template helm-chart/jupyterhub-ssh --values helm-chart/jupyterhub-ssh/values.lint.yaml
test-chart-install:
runs-on: ubuntu-20.04
timeout-minutes: 20
strategy:
# Keep running even if one variation of the job fail
fail-fast: false
matrix:
# We run this job multiple times with different parameterization
# specified below, these parameters have no meaning on their own and
# gain meaning on how job steps use them.
#
# k3s-version: https://github.com/rancher/k3s/tags
# k3s-channel: https://update.k3s.io/v1-release/channels
include:
- k3s-channel: v1.21
debuggable: debuggable
- k3s-channel: v1.20
- k3s-channel: v1.19
- k3s-channel: v1.18
- k3s-channel: v1.17
steps:
- uses: actions/checkout@v2
with:
# chartpress requires the full history
fetch-depth: 0
# Starts a k8s cluster with NetworkPolicy enforcement and installs both
# kubectl and helm
#
# action reference: https://github.com/jupyterhub/action-k3s-helm/
- uses: jupyterhub/action-k3s-helm@v1
with:
k3s-channel: ${{ matrix.k3s-channel }}
metrics-enabled: false
traefik-enabled: false
docker-enabled: true
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
pip install -r dev-requirements.txt
pip list
helm version
# Build our images if needed and update values.yaml with the tags
- name: Run chartpress
run: |
cd helm-chart
chartpress
- name: Generate values.schema.json from schema.yaml
run: helm-chart/tools/generate-json-schema.py
# Validate rendered helm templates against the k8s api-server with the
# dedicated values.lint.yaml config.
- name: Helm template --validate (with lint config)
run: helm template --validate jupyterhub-ssh helm-chart/jupyterhub-ssh --values helm-chart/jupyterhub-ssh/values.lint.yaml
# FIXME: Add back when we are using pytest do test something more
# complicated than just installing the chart by itself.
# - name: Install jupyterhub
# run: helm install jupyterhub --repo https://jupyterhub.github.io/helm-chart/ jupyterhub
- name: Install jupyterhub-ssh
run: helm install jupyterhub-ssh helm-chart/jupyterhub-ssh --values helm-chart/jupyterhub-ssh/values.dev.yaml
- name: Await readiness
uses: jupyterhub/action-k8s-await-workloads@v1
with:
timeout: 150
max-restarts: 0
# FIXME: Setup pytest tests against our deployed Helm chart
#
# - name: Run tests
# run: |
# pytest --verbose --maxfail=2 --color=yes ./helm-chart/tests
# action reference: https://github.com/jupyterhub/action-k8s-namespace-report
- name: Kubernetes namespace report
uses: jupyterhub/action-k8s-namespace-report@v1
if: always()
with:
important-workloads: deploy/jupyterhub-ssh deploy/jupyterhub-sftp deploy/hub
# WARNING: Only allow this for pull_request runs that doesn't contain
# sensitive information.
#
# action reference: https://github.com/mxschmitt/action-tmate@v3
- name: To enter a SSH debugging session, read these logs
if: failure() && github.event_name == 'pull_request' && matrix.debuggable == 'debuggable'
uses: mxschmitt/action-tmate@v3