-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (66 loc) · 1.57 KB
/
tests.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
70
71
72
73
74
75
76
77
78
79
---
name: Tests
on:
push:
tags-ignore:
- '**'
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
strategy:
fail-fast: true
max-parallel: 2
matrix:
kubernetes:
- v1.22.15
- v1.23.12
- v1.24.6
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Setup Cache for Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build source files
run: go build ./...
- name: Install kubectl
uses: azure/setup-kubectl@v3
with:
version: ${{ matrix.kubernetes }}
- name: Create KinD cluster
uses: helm/[email protected]
with:
version: v0.17.0
node_image: kindest/node:${{ matrix.kubernetes }}
cluster_name: kind
wait: 120s
- name: Install Tekton
run: hack/install-tekton.sh
- name: Install Shipwright
run: hack/install-shipwright.sh
- name: Run Tests
run: |
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
make test
- name: Upload Code Coverage Profile
uses: codecov/codecov-action@v3
with:
threshold: 2%
files: unit.coverprofile
flags: unittests
fail_ci_if_error: true
verbose: false