Skip to content

Commit c50f3d3

Browse files
authored
Add ci validation (#153)
1 parent 6b4bcea commit c50f3d3

File tree

5 files changed

+74
-2
lines changed

5 files changed

+74
-2
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Lint and Test charts
2+
on:
3+
push:
4+
branches:
5+
- release/**
6+
pull_request:
7+
8+
jobs:
9+
lint-test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set up Helm
18+
uses: azure/setup-helm@v3
19+
with:
20+
version: v3.9.1
21+
- uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.7
24+
- uses: azure/[email protected]
25+
id: install
26+
- name: Set up chart-testing
27+
uses: helm/[email protected]
28+
29+
- name: Run chart-testing (list-changed)
30+
id: list-changed
31+
run: |
32+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
33+
if [[ -n "$changed" ]]; then
34+
echo "::set-output name=changed::true"
35+
fi
36+
- name: Helm lint
37+
run: |
38+
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
39+
echo $changed | xargs helm lint
40+
if: steps.list-changed.outputs.changed == 'true'
41+
- name: Create kind cluster
42+
uses: helm/[email protected]
43+
if: steps.list-changed.outputs.changed == 'true'
44+
45+
- name: Install Helm charts
46+
run: helm install --debug -f ./ci/override.yaml test-sg ./charts/sourcegraph/
47+
- name: Wait for frontend to come up
48+
run: sleep 60s && kubectl wait --for=condition=Ready -l app=sourcegraph-frontend pod --timeout=300s
49+
shell: bash
50+
- name: Run Helm Testing
51+
run: helm test test-sg

charts/sourcegraph-migrator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: sourcegraph-migrator
33
description: Chart for running Sourcegraph migrator
4-
4+
icon: https://sourcegraph.com/favicon.ico
55
type: application
66

77
# Chart version, separate from Sourcegraph

charts/sourcegraph/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: sourcegraph
33
description: Chart for installing Sourcegraph
4-
4+
icon: https://sourcegraph.com/favicon.ico
55
type: application
66

77
# Chart version, separate from Sourcegraph
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: "sg-test-connection"
5+
labels:
6+
{{- include "sourcegraph.labels" . | nindent 4 }}
7+
annotations:
8+
"helm.sh/hook": test
9+
spec:
10+
containers:
11+
- name: wget
12+
image: busybox
13+
command: ['wget']
14+
args: ['sourcegraph-frontend:30080/']
15+
restartPolicy: Never

ci/override.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
storageClass:
2+
create: false
3+
name: standard
4+
5+
sourcegraph:
6+
localDevMode: true

0 commit comments

Comments
 (0)