This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
107 lines (100 loc) · 2.88 KB
/
ci.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
name: quarks-secret-ci
on:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.8
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: |
go install github.com/onsi/ginkgo/ginkgo
go get github.com/mattn/goveralls
go get github.com/modocache/gover
go get -u golang.org/x/lint/golint
curl -LO https://github.com/dominikh/go-tools/releases/download/2020.2.2/staticcheck_linux_amd64.tar.gz
sudo tar xfz staticcheck_linux_amd64.tar.gz --strip-component 1 -C $GOPATH/bin staticcheck/staticcheck
- name: Install shared tools
run: |
bin/tools
- name: Run lint
run: |
bin/lint
- name: Run unit tests
run: |
bin/test-unit
env:
COVERAGE: true
GOPROXY: "https://proxy.golang.org"
- uses: actions/upload-artifact@master
with:
name: coverage-files
path: ./code-coverage
cluster-tests:
needs: [unit-tests]
runs-on: ubuntu-latest
strategy:
matrix:
kubernetes_version: [v1.16.4,v1.18.0]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15.8
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/download-artifact@master
with:
name: coverage-files
path: ./code-coverage
- name: Install Go dependencies
run: |
go install github.com/onsi/ginkgo/ginkgo
go get github.com/mattn/goveralls
go get github.com/modocache/gover
- name: Install shared tools
run: |
bin/tools
- name: Prepare GITHUB_ACTION_BRANCH env
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: prepare_branch_env
- name: Create k8s Kind Cluster
uses: engineerd/[email protected]
with:
version: v0.8.0
image: kindest/node:${{matrix.kubernetes_version}}
- name: Run cluster tests
run: |
bin/build-image
bin/test-integration
bin/test-cli-e2e
bin/build-helm
bin/test-helm-e2e
bin/coverage
env:
PROJECT: quarks-secret
GITHUB_ACTION_BRANCH: ${{ steps.prepare_branch_env.outputs.branch }}
USE_KIND: true
COVERAGE: true
GOPROXY: "https://proxy.golang.org"
- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: ./code-coverage/gover.coverprofile