-
Notifications
You must be signed in to change notification settings - Fork 103
69 lines (56 loc) · 1.56 KB
/
build.yml
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
name: Compile & Test
on:
push:
branches:
- master
pull_request:
jobs:
verify_helm:
name: Verify Helm chart
runs-on: ubuntu-latest
strategy:
matrix:
helm: [ '3.10.3' ]
steps:
- uses: actions/checkout@v2
- name: Set up Helm
run: |
wget https://get.helm.sh/helm-v${{ matrix.helm }}-linux-amd64.tar.gz -O /tmp/helm.tar.gz
tar xzf /tmp/helm.tar.gz -C /tmp --strip-components=1
chmod +x /tmp/helm
- name: Test template rendering
run: /tmp/helm template ./deploy/helm-chart/kubernetes-replicator/.
- name: Lint chart
run: /tmp/helm lint ./deploy/helm-chart/kubernetes-replicator/
build:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: "1.20"
- name: Compile
run: go build .
- name: Go vet
run: go vet ./...
tests:
name: Run tests suite
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: "1.20"
- uses: actions/checkout@v2
- name: Set up KIND
run: |
wget -O ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.17.0/kind-linux-amd64
chmod +x ./kind
- name: Start cluster
run: |
./kind create cluster
./kind get kubeconfig > ./kind-kubeconfig
- name: Run unit tests
run: KUBECONFIG=$PWD/kind-kubeconfig go test ./...