Skip to content

Commit 2978f9b

Browse files
authored
ci: add integration tests using kind (#163)
1 parent e5e85bb commit 2978f9b

File tree

2 files changed

+62
-8
lines changed

2 files changed

+62
-8
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,26 @@ jobs:
2828
quick:
2929
runs-on: ubuntu-20.04
3030
steps:
31-
- name: Cancel Previous Runs
31+
- name: Cancel previous runs
3232
uses: styfle/cancel-workflow-action@0.9.1
33+
if: github.event_type == 'pull_request'
3334

34-
- uses: actions/checkout@v2
35+
- name: Checkout source
36+
uses: actions/checkout@v2
3537

36-
- name: Install Dependencies
38+
- name: Install dependencies
3739
run: ./scripts/install_deps.sh
3840

39-
- name: Lint Helm Chart
41+
- name: Lint Helm chart
4042
run: make lint/helm
4143

4244
- name: Check formatting and docs
4345
run: ./scripts/fmt.sh
4446

45-
- name: Lint Shell Scripts
47+
- name: Lint shell scripts
4648
run: make lint/shellcheck
4749

48-
- name: Lint Kubernetes Templates
50+
- name: Lint Kubernetes templates
4951
run: make lint/kubernetes
5052

5153
- name: Install Go
@@ -56,5 +58,54 @@ jobs:
5658
- name: Unit tests
5759
run: ./scripts/test_go.sh
5860

59-
- name: Package Helm Chart
61+
- name: Package Helm chart
6062
run: ./scripts/package.sh
63+
64+
# Integration test: deploy into a local kind cluster
65+
integration-kind:
66+
runs-on: ubuntu-20.04
67+
name: "integration/kind"
68+
steps:
69+
- name: Cancel previous runs
70+
uses: styfle/cancel-workflow-action@0.9.1
71+
if: github.event_type == 'pull_request'
72+
73+
- name: Checkout source
74+
uses: actions/checkout@v2
75+
76+
- name: Install dependencies
77+
run: ./scripts/install_deps.sh
78+
79+
- name: Start kind cluster
80+
uses: container-tools/kind-action@v1
81+
82+
- name: Show environment data
83+
run: |
84+
set -x
85+
docker ps -a
86+
printenv
87+
kubectl cluster-info
88+
kubectl config view
89+
90+
- name: Install Coder
91+
run: |
92+
helm install coder-test . \
93+
--create-namespace \
94+
--namespace=coder-test \
95+
--wait \
96+
--debug \
97+
--values=examples/kind/kind.values.yaml \
98+
--values=examples/images.yaml \
99+
--set=coderd.image=docker.io/coderenvs/coder-service:1.24.0 \
100+
--set=coderd.serviceSpec.type=ClusterIP \
101+
--set=coderd.serviceSpec.externalTrafficPolicy="" \
102+
--set=postgres.default.image=docker.io/coderenvs/timescale:1.24.0 \
103+
--set=envbox.image=docker.io/coderenvs/envbox:1.24.0
104+
105+
- name: Get running info
106+
if: always()
107+
run: |
108+
set -x
109+
kubectl --namespace=coder-test describe all
110+
kubectl --namespace=coder-test logs statefulset/timescale
111+
kubectl --namespace=coder-test logs deployment/coderd

examples/images.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Dummy image tags
22
coderd:
33
image: gcr.io/coder/coder-service:2.0.0
4+
45
postgres:
5-
image: gcr.io/coder/timescale:2.0.0
6+
default:
7+
image: gcr.io/coder/timescale:2.0.0
8+
69
envbox:
710
image: gcr.io/coder/envbox:2.0.0

0 commit comments

Comments
 (0)