forked from goharbor/harbor-helm
-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 2.29 KB
/
integration.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
name: Integration test
on:
pull_request:
push:
jobs:
integration-test:
runs-on: ubuntu-latest
strategy:
matrix:
k8s_version: [v1.25.3, v1.24.7, v1.23.13]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create kind cluster
uses: helm/[email protected]
with:
version: v0.17.0
node_image: kindest/node:${{ matrix.k8s_version }}
cluster_name: kind-cluster-${{ matrix.k8s_version }}
config: test/integration/kind-cluster.yaml
- name: Install Nginx ingress controller
run: |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.3/deploy/static/provider/kind/deploy.yaml
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=120s
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: "1.19"
- name: Cache go mod
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set /etc/hosts
run: |
sudo -- sh -c "echo '127.0.0.1 harbor.local' >> /etc/hosts"
- name: Run integration tests
working-directory: ./test
run:
go test -v -timeout 30m github.com/goharbor/harbor-helm/integration
- name: fetch harbor logs
if: failure()
run: |
df -h
free -m
mkdir -p /tmp/harbor
for name in core jobservice registry registryctl trivy portal redis database; do \
kubectl -n default logs -l "component=$name" --all-containers > /tmp/harbor/$name.log ; \
done
- uses: actions/upload-artifact@v2
if: failure()
with:
name: harbor_${{ matrix.k8s_version }}_${{ runner.os }}
path: /tmp/harbor
- name: fetch logs
if: failure()
run: |
mkdir -p /tmp/logs
kind export logs --name kind-cluster-${{ matrix.k8s_version }} /tmp/logs
- uses: actions/upload-artifact@v2
if: failure()
with:
name: kind_v${{ matrix.k8s_version }}
path: /tmp/logs